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.
- Listed in Global namespace: C to D
- Inherits or implements
HashSetAction<DockObjectTaskArgument> - Nested types
Filters - Attributes
CreateAssetMenu
Constructors
| Member | What it is |
|---|---|
DockObjectTask() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private List<uint> dockPrefabs | Network prefab hashes of the docks that count. |
private HashSet<uint> dockPrefabsHashes | Lookup set built from dockPrefabs. |
private DockObjectTask.Filters filters | Flags choosing whether docks by the player themselves, by others, or both count. Defaults to both. |
private List<PickupDockSettings> possibleDocks | Dock settings assets that count. |
private HashSet<PickupDockSettings> targetDocksHash | Lookup set built from possibleDocks. |
private List<Item> targetItems | Items whose docking counts. |
private HashSet<uint> targetItemsHash | Lookup set of item hashes built from targetItems. |
Properties
| Member | What it is |
|---|---|
override GameActionChannel Channel { get; } | Always GameActionChannel.DockObject, so the task only listens for dock events. |
Methods
| Member | What 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. |