Skip to main content

DockObjectTask

A class in Root.Township, the global namespace.

Game task asset (Dock Object channel) that counts docking a pickup, filtered by item, dock settings, dock prefab and whether the player docked it themselves.

Constructors​

MemberWhat it is
DockObjectTask()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

7 private and internal fields
MemberWhat it is
private List<uint> dockPrefabsNetwork prefab hashes of the docks that count.
private HashSet<uint> dockPrefabsHashesLookup set built from dockPrefabs.
private DockObjectTask.Filters filtersFlags choosing whether docks by the player themselves, by others, or both count. Defaults to both.
private List<PickupDockSettings> possibleDocksDock settings assets that count.
private HashSet<PickupDockSettings> targetDocksHashLookup set built from possibleDocks.
private List<Item> targetItemsItems whose docking counts.
private HashSet<uint> targetItemsHashLookup set of item hashes built from targetItems.

Properties​

MemberWhat it is
override GameActionChannel Channel { get; }Always GameActionChannel.DockObject, so the task only listens for dock events.

Methods​

MemberWhat it is
protected override void Initialize()Copies the serialized item, dock settings and dock prefab lists into the lookup hash sets.
protected override bool IsValid(DockObjectTaskArgument argument)True when the docked item, dock settings and dock prefab pass their filters (empty lists probably accept anything) and the self/others filter allows it.