Chessistics/chessistics-engine/Model/DemandDef.cs

23 lines
744 B
C#
Raw Permalink Normal View History

namespace Chessistics.Engine.Model;
/// <summary>
/// A demand building.
///
/// Classic mode (default): counts deliveries up to <see cref="Amount"/>,
/// then <see cref="DemandState.IsSatisfied"/> stays true forever.
///
/// Recurring mode: set <see cref="ConsumptionPerTurn"/> &gt; 0. The demand
/// holds a buffer of delivered cargo; each turn it consumes that many
/// units. If the buffer runs dry it enters shortage. The demand is
/// considered satisfied once it has spent <see cref="SustainTurns"/>
/// consecutive turns without shortage.
/// </summary>
public record DemandDef(
Coords Position,
string Name,
CargoType Cargo,
int Amount,
int Deadline = 0,
int ConsumptionPerTurn = 0,
int SustainTurns = 0);