Producer
namespace Griff.Modules.Strategy;
public sealed class Producer : Component, INetStateTrains units at a Building: select it and press a unit’s hotkey (or click its button) to queue one up. The team pays the unit’s cost straight away, and needs the supply for it. Finished units walk out to the rally point.
This is a component: its saved properties are on its component page.
Properties
Section titled “Properties”Progress
Section titled “Progress”public float Progress { get; }How far along the first in line is, from 0 to 1.
public IReadOnlyList<string> Queue { get; }What it’s training, first in line first.
QueueLimit
Section titled “QueueLimit”public int QueueLimit { get; set; }How many it can have queued up at once.
Queued
Section titled “Queued”public int Queued { get; }How many units it has queued up, the one in training included.
Trains
Section titled “Trains”public string? Trains { get; set; }The prefabs it trains, e.g. “Worker” or “Soldier, Archer”. Each needs a Unit.
Methods
Section titled “Methods”CancelLast
Section titled “CancelLast”public void CancelLast()Cancels the last unit queued, giving back what it cost.
Options
Section titled “Options”public IReadOnlyList<string> Options()The prefab names in Trains.
public void Train(string? unit = null)Queues up a unit it trains, one of Trains (the first without one), as its button does: its team pays for it and needs the supply. A trigger, a card or a wire can train an army.
Events
Section titled “Events”Trained
Section titled “Trained”public event Action<Entity>? TrainedRaised with each unit it finishes.