Skip to content

Worker

namespace Griff.Modules.Strategy;
public sealed class Worker : Component

Lets a Unit gather and build. Right-click a Resource and it fetches loads of it back to the nearest depot (a Building with Depot ticked) over and over; select it and press a building’s hotkey to place one of its Builds.

This is a component: its saved properties are on its component page.

public string? Builds { get; set; }

The building prefabs it can put up, e.g. “Farm, Barracks, Tower”. Each needs a Building.

public int Carry { get; set; }

How much it carries back each trip.

public string? Carrying { get; }

What it’s carrying, e.g. “Gold”, or empty.

public float GatherTime { get; set; }

Seconds it takes to gather a load.

public int Load { get; }

How much it’s carrying.

public Entity? Source { get; }

The resource it goes back to after dropping off a load.

public void Gather(Entity resource)

Sends it to gather from resource.

public IReadOnlyList<string> Options()

The building prefabs in Builds.