Raymond Maarloeve
Loading...
Searching...
No Matches
BuildingData Class Reference

Component responsible for tracking a building's tile occupation, type, and association with NPCs. Provides methods for assigning occupied tiles and marking the main tile for the building. More...

Public Types

enum  BuildingType {
  None , House , Church , Well ,
  Blacksmith , Tavern , Scaffold , Wall ,
  Armoury , Barracks , Fortress , Tower ,
  Gate , Tree , Bush , Stone ,
  Small_Decoration , Clue , Other
}
 Available building type enumerations. More...
 

Public Member Functions

bool AssignOccupiedTiles (float tileSize, Tile[,] tiles)
 Attempts to assign the tiles that this building occupies, based on its bounding box. If any tile is already occupied, the method fails.
 
void AssignWallTilesForcefully (float tileSize, Tile[,] tiles)
 Assigns tiles as occupied without checking for collisions. Intended for walls, gates, and towers.
 

Public Attributes

Tile HisMainTile = null
 The main tile this building is associated with (e.g., for pathfinding or interaction).
 
List< NPCHisNPC = null
 List of NPCs associated with this building.
 
Vector2Int HisMainTileGridPosition = new Vector2Int(-1, -1)
 Grid coordinates of the main tile.
 
BuildingType HisType = BuildingType.None
 Type of building represented by this component.
 
List< TileHisTiles = new()
 All tiles occupied by this building.
 
int HisTileCount = 0
 The number of tiles currently occupied by this building.
 

Detailed Description

Component responsible for tracking a building's tile occupation, type, and association with NPCs. Provides methods for assigning occupied tiles and marking the main tile for the building.

Member Enumeration Documentation

◆ BuildingType

Available building type enumerations.

Enumerator
None 
House 
Church 
Well 
Blacksmith 
Tavern 
Scaffold 
Wall 
Armoury 
Barracks 
Fortress 
Tower 
Gate 
Tree 
Bush 
Stone 
Small_Decoration 
Clue 
Other 

Member Function Documentation

◆ AssignOccupiedTiles()

bool BuildingData.AssignOccupiedTiles ( float  tileSize,
Tile  tiles[,] 
)

Attempts to assign the tiles that this building occupies, based on its bounding box. If any tile is already occupied, the method fails.

Parameters
tileSizeWorld size of one tile.
tiles2D array of all tiles on the map.
Returns
True if assignment succeeded; false if a collision occurred or data is missing.

◆ AssignWallTilesForcefully()

void BuildingData.AssignWallTilesForcefully ( float  tileSize,
Tile  tiles[,] 
)

Assigns tiles as occupied without checking for collisions. Intended for walls, gates, and towers.

Parameters
tileSizeSize of one tile in world units.
tilesThe full tile grid.

Member Data Documentation

◆ HisMainTile

Tile BuildingData.HisMainTile = null

The main tile this building is associated with (e.g., for pathfinding or interaction).

◆ HisMainTileGridPosition

Vector2Int BuildingData.HisMainTileGridPosition = new Vector2Int(-1, -1)

Grid coordinates of the main tile.

◆ HisNPC

List<NPC> BuildingData.HisNPC = null

List of NPCs associated with this building.

◆ HisTileCount

int BuildingData.HisTileCount = 0

The number of tiles currently occupied by this building.

◆ HisTiles

List<Tile> BuildingData.HisTiles = new()

All tiles occupied by this building.

◆ HisType

BuildingType BuildingData.HisType = BuildingType.None

Type of building represented by this component.


The documentation for this class was generated from the following file: