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.
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 withMatchMetadata
.