rogersanick / SettlersOfCordan

Other
11 stars 4 forks source link

Attempt at using many to 1 relationship from road to board. #33

Closed xavierlepretre closed 5 years ago

xavierlepretre commented 5 years ago

It is an example, for discussion. Beside this way of doing, I see there is a LinearPointer class.

xavierlepretre commented 5 years ago

With LinearPointer, it remains to be found how to query the vault for states that point to the desired other state.

rogersanick commented 5 years ago

Hey @xavierlepretre - looks good to me! I had just fixed the logic inversion locally. Will merge this instead. Let me know when it's good to go!

xavierlepretre commented 5 years ago

I got rid of LinearPointer because it is useful in a narrower use case than I thought. The pointed-to state has to already be committed to the vault, and, at most, be an input reference state of a tx.

It would be useful if our GameBoardState was in 2 parts, and we pointed to the immutable part.

I am going to have a look at where I can make simple use of these new links back. And get the tests not to fail because of the additions. 😅

rogersanick commented 5 years ago

Re: the LinearPointer - makes sense to me! Let me know if I can help. Will likely merge in the longest road PR today.

Not sure I fully understand splitting the Gameboard into two parts. I think once it's committed to the ledger the whole thing would be immutable no? Or are you referring to the GameBoardState class when its instantiated in a flow?

xavierlepretre commented 5 years ago

WRT the immutable part, I am thinking that:

  1. the tiles, their resources, the ports, they do not change as the game progresses
  2. the roads, settlements, robber, they do change.

So 1. should be a state, that is used as a reference through out the game And 2. should be consumable states of some sort.

xavierlepretre commented 5 years ago

@rogersanick I think it is good to merge for now.