Building
namespace Griff.Modules.Strategy;
public sealed class Building : Component, INetState, ITeamMemberA building: it stands still, takes up its Size on the map (units walk around it), and belongs to a team. Workers put it up when it’s placed (see Builds); a Producer on it trains units, a Fighter makes it a tower, and Depot lets workers bring resources back to it.
This is a component: its saved properties are on its component page.
Properties
Section titled “Properties”BuildTime
Section titled “BuildTime”public float BuildTime { get; set; }Seconds a worker takes to put it up.
public string? Cost { get; set; }What it costs to build, e.g. “150 Gold, 50 Wood”.
public bool Depot { get; set; }Whether workers bring gathered resources back here: a town hall.
Hotkey
Section titled “Hotkey”public string? Hotkey { get; set; }The key that builds it, e.g. “B”. Empty uses its first letter.
IsBuilt
Section titled “IsBuilt”public bool IsBuilt { get; }True once it’s finished: only then does it train, take resources, provide supply or shoot.
IsSelected
Section titled “IsSelected”public bool IsSelected { get; }True while the player has it selected.
Progress
Section titled “Progress”public float Progress { get; set; }How far along it is, from 0 (just placed) to 1 (finished). Buildings in a scene start finished.
public Vector2? Rally { get; set; }Where units it trains walk to. Right-click with it selected to set it.
RallyTarget
Section titled “RallyTarget”public Entity? RallyTarget { get; set; }A resource units it trains go and gather from, if the rally point was set on one.
public float Sight { get; set; }How far it sees through the fog of war.
public Vector2 Size { get; set; }The ground it covers, in world units; units walk around it.
Supply
Section titled “Supply”public int Supply { get; set; }The supply it provides its team once it’s up: farms and houses.
public string? Team { get; set; }The team it’s on: a Faction’s Team.
Events
Section titled “Events”Finished
Section titled “Finished”public event Action<Building>? FinishedRaised when it’s finished.