2026-04-10 14:58:03 +02:00
|
|
|
namespace Chessistics.Engine.Model;
|
|
|
|
|
|
2026-04-17 22:39:28 +02:00
|
|
|
/// <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"/> > 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);
|