Closed Itangalo closed 2 years ago
Yep, I really think pawns should be a class of its own. Probably worth fixing to 1.1 -- waiting will only cause more changes to existing code.
And: It should still be possible to not add pawns in advance, and just start moving them (if 'assumePresent' is true).
Mind dump:
Pawns have
When created, they are put on start space by default. And added to the track (myTrack.pawns[pawnId]. If ID matches one of the agent's, what happens? Probably agent[trackId].pawn, which would for example be agent.board.pawn or agent.culture.pawn. Makes sense.
I have come more than half way through this refactoring. Pawns and tracks become much more clear and easy to work with. Good decision.
Tests left. And the bug fixing.
Done!
There is a bit of information connected to pawns on tracks – space id, space index and sometimes path as well. If they were a class of their own, it would probably be cleaner.
Two other advantages:
Not something to do right now, but to keep in mind.