fabienjuif / subterra

Not finished clone of subterra board game
https://pedantic-lalande-d5e881.netlify.com/
0 stars 0 forks source link

:recycle: seed base tiles draw #102

Closed fabienjuif closed 4 years ago

fabienjuif commented 4 years ago

related to #101 related to #98

fabienjuif commented 4 years ago

I wonder if we have to set tiles in the state here since I added uid. Maybe just a map [id]: remainingValue is enough if we share cards data somewhere...

JSON.stringify(state.tiles).length
> 6736
JSON.stringify({ ...state.tiles, deck: state.tiles.deck.reduce((deck, { tile, remaining }) => ({ ...deck, [tile.id]: remaining }), {}) }).length
727
{
  "remaining": 11,
  "deck": {
    "Pfn8vlHx1b51VsiNIyScj": 1,
    "KB6PqUfbLZ9UE4QBu-Fne": 1,
    "yA-tGd1qwHzfb2VhStf2B": 1,
    "nzisSEndGakUiAuzfIFVF": 1,
    "yyrTb2mLi7-wsaCgTOjZF": 1,
    "lDAh6cMuKRibgfFqpkcza": 1,
    "7-ieW8glNb79icRDk1K1W": 1,
    "r-R-BTC0H4OmyFDBPQJuT": 1,
    "iODsx23TbApGvJhFyWqMM": 1,
    "vn0_eykg1uHmW0OVYokBz": 1,
    "euBLqqryDfNyrUV3eqh1D": 1,
    "HN0w_Pav5wh_s5d2PEp_A": 1,
    "xNjLi8WCXxaBCRQvdLTas": 1,
    "2CTuGVylqs7ejWFoLHsiw": 1,
    "EfssmBj1Gg0i3zAKKlSGQ": 1,
    "I-NRDVCDl7CSP7fV5FxDY": 1,
    "GL3wvjvDRUNq13upLe29u": 1,
    "45-EbI8thaUszH0kxRvxz": 1,
    "S7Z47I_FFW-ZSumM8aiJ5": 1,
    "8d2V4rOPI-kIkAx5s583p": 1,
    "AeEQazY4QCBBb3Kt_yQuU": 1,
    "aYbJvk_Vrwx0OFFMBmn22": 1,
    "HwfQuoy7wU70-8cXVzqN9": 1,
    "hglerRhkulhXcf09fT_qP": 1,
    "7LxK3CZ1NHamA7-N3LodL": 1,
    "L0nblDzgW3Q4P6-zffoqG": 1,
    "_wbDKHo0T69uSO1qclmqj": 1
  }
}
fabienjuif commented 4 years ago

With this optimisation (https://github.com/fabienjuif/subterra/issues/103) and the previous comment one we should have a state of 3k