![]() |
Raymond Maarloeve
|
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< NPC > | HisNPC = 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< Tile > | HisTiles = new() |
All tiles occupied by this building. | |
int | HisTileCount = 0 |
The number of tiles currently occupied by this building. | |
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.
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.
tileSize | World size of one tile. |
tiles | 2D array of all tiles on the map. |
void BuildingData.AssignWallTilesForcefully | ( | float | tileSize, |
Tile | tiles[,] | ||
) |
Assigns tiles as occupied without checking for collisions. Intended for walls, gates, and towers.
tileSize | Size of one tile in world units. |
tiles | The full tile grid. |
Tile BuildingData.HisMainTile = null |
The main tile this building is associated with (e.g., for pathfinding or interaction).
Vector2Int BuildingData.HisMainTileGridPosition = new Vector2Int(-1, -1) |
Grid coordinates of the main tile.
List<NPC> BuildingData.HisNPC = null |
List of NPCs associated with this building.
int BuildingData.HisTileCount = 0 |
The number of tiles currently occupied by this building.
List<Tile> BuildingData.HisTiles = new() |
All tiles occupied by this building.
BuildingType BuildingData.HisType = BuildingType.None |
Type of building represented by this component.