Skip to content

Producer

namespace Griff.Modules.Strategy;
public sealed class Producer : Component, INetState

Trains 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.

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.

public int QueueLimit { get; set; }

How many it can have queued up at once.

public int Queued { get; }

How many units it has queued up, the one in training included.

public string? Trains { get; set; }

The prefabs it trains, e.g. “Worker” or “Soldier, Archer”. Each needs a Unit.

public void CancelLast()

Cancels the last unit queued, giving back what it cost.

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.

public event Action<Entity>? Trained

Raised with each unit it finishes.