bananu7 / rts

MIT License
7 stars 0 forks source link

Dynamic building grid #53

Closed bananu7 closed 1 year ago

bananu7 commented 1 year ago

This PR directly addresses #39 by changing pathfinding to allow for two types of "destinations" - units and map locations. For units, special logic in game.ts:515-525 determines whether the unit is a building, and if so instructs the pathfinder to find a path towards any path taken by the building (which will effectively only consider extents anyway).

Some small changes and refactorings include renaming "Action" to "Command" and removing UnitState and the "State" logic completely, replacing them with MatchMetadata.