This repository was archived by the owner on Oct 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Datastructure thoughts #13
Labels
Comments
Thanks to Liquidor for this. His thoughts on the state: http://pastebin.com/raw/UA9jgGrH |
@inooid Have you considered trying to normalize the state shape like in the redux docs? The flatter state shape might make it easier to work with. Something like this: {
playersById: {
'you':{
id: 'you',
name: 'Inooid'
health: 30,
mana: 1,
armor: 0,
damage: 0,
weapon: weaponId1,
hero: heroId1
deck: [cardId, cardId, ...]
board: [minionId, minionId, ...]
},
'opponent':{
id: 'opponent',
name: 'Kanopi',
health: 30,
mana: 1,
weapon: weaponId2,
hero: 'heroId1'
heropower: 'heropowerId1'
}
},
turn: 'you',
heroesById: {
'heroId1':{
heroClass: 'Warlock'
portrait: ''
power: powerId
},
'heroId2':{{
heroClass: 'Warlock'
portrait: ''
power: powerId
}
},
weaponsById: {
...
},
heropowersById: {
...
}
minionsById: {
...
}
} |
@Bebersohl Thanks for your input! This issue is slightly outdated, but you've touched some valid points. I will reconsider the overall state as soon as I have some more time to work on this. 👍 Appreciate your input a lot! |
Cool, let me know when you start working on this again. I would like to
contribute.
Brandon
…On Fri, Dec 16, 2016 at 11:10 AM, Boyd Dames ***@***.***> wrote:
@Bebersohl <https://github.com/Bebersohl> Thanks for your input! This
issue is slightly outdated, but you've touched some valid points. I will
reconsider the overall state as soon as I have some more time to work on
this. 👍
Appreciate your input a lot!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AG5hhRJ7bct-sxItIqQVfHABrWm1gF10ks5rIsXpgaJpZM4H-SkI>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Structure 1:
Structure 2:
My preference goes to structure 2, but if there's any other way of doing it, I am open to suggestions!
The text was updated successfully, but these errors were encountered: