Stock Item, keeping the same order as played.
Posted: 04 April 2019, 22:31
I have a stock item, where cards get played to. (addToStockWithId)
http://en.doc.boardgamearena.com/Stock
I need to keep the display order as the same order in which the cards are played.
I can't use a weight to start with because I don't know the order they will be played in the future.
I could dynamically use changeItemsWeight() as they get played, although I haven't tried. The problem I foresee is that when the page refreshes F5 then the order will get lost.
So that seems I need to save the order to the DB, but that seems very long winded.
Am I missing something obvious?
------------------------------------------
Answer my own question, I am going to use the 'card_location_arg' field of the Card DB to help maintain the play order.
http://en.doc.boardgamearena.com/Stock
I need to keep the display order as the same order in which the cards are played.
I can't use a weight to start with because I don't know the order they will be played in the future.
I could dynamically use changeItemsWeight() as they get played, although I haven't tried. The problem I foresee is that when the page refreshes F5 then the order will get lost.
So that seems I need to save the order to the DB, but that seems very long winded.
Am I missing something obvious?
------------------------------------------
Answer my own question, I am going to use the 'card_location_arg' field of the Card DB to help maintain the play order.