380 changes: 129 additions & 251 deletions src/structure.cpp

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/structure.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ bool removeStruct(STRUCTURE *psDel, bool bDestroy);
//fills the list with Structures that can be built
extern UDWORD fillStructureList(STRUCTURE_STATS **ppList, UDWORD selectedPlayer,
UDWORD limit);
/* checks that the location is a valid one to build on and sets the outline colour
x and y in tile-coords*/
extern bool validLocation(BASE_STATS *psStats, unsigned x, unsigned y, uint16_t direction, unsigned player, bool bCheckBuildQueue);

/// Checks if the two structures would be too close to build together.
bool isBlueprintTooClose(STRUCTURE_STATS const *stats1, Vector2i pos1, uint16_t dir1, STRUCTURE_STATS const *stats2, Vector2i pos2, uint16_t dir2);

/// Checks that the location is valid to build on.
/// pos in world coords
bool validLocation(BASE_STATS *psStats, Vector2i pos, uint16_t direction, unsigned player, bool bCheckBuildQueue);

bool isWall(STRUCTURE_TYPE type); ///< Structure is a wall. Not completely sure it handles all cases.
bool isBuildableOnWalls(STRUCTURE_TYPE type); ///< Structure can be built on walls. Not completely sure it handles all cases.
Expand Down