Game.Simulation.ICitySystem
Assembly: Assembly-CSharp
Namespace: Game.Simulation
Type: interface
Base: N/A
Summary:
Represents a small contract/interface for a city system that exposes the current money amount. Intended to be implemented by systems that track or provide access to the city's money balance for other subsystems or UI.
Fields
- None
This interface declares no fields.
Properties
public int moneyAmount { get; }
Read-only property that returns the current money amount (balance) for the implementing city system. The property is intended to be queried by other systems, UI code, or debugging tools to obtain the city's current monetary value.
Constructors
- None
Interfaces do not define constructors.
Methods
- None
This interface defines no methods beyond the property accessor.
Usage Example
// Example implementation of ICitySystem
public class CityMoneySystem : ICitySystem
{
private int _moneyAmount;
public int moneyAmount => _moneyAmount;
public CityMoneySystem(int startingMoney)
{
_moneyAmount = startingMoney;
}
public void AddIncome(int amount) => _moneyAmount += amount;
public void Spend(int amount) => _moneyAmount -= amount;
}
// Example usage
ICitySystem citySystem = new CityMoneySystem(100000);
int currentMoney = citySystem.moneyAmount;