public RoamingJobState(Vector3Int pos, Colony colony, string objectiveType, IRoamingJobObjective settings = null) { Position = pos; RoamObjective = objectiveType; Colony = colony; if (settings == null) { RoamingJobSettings = RoamingJobManager.GetCallbacks(objectiveType); } else { RoamingJobSettings = settings; } Initialize(); }
public RoamingJobState(JSONNode baseNode, Colony colony) { Position = (Vector3Int)baseNode[nameof(Position)]; Colony = colony; if (baseNode.TryGetAs <string>(nameof(RoamObjective), out var ro)) { RoamObjective = ro; } if (baseNode.TryGetAs(nameof(ActionEnergy), out JSONNode ItemsRemovedNode) && ItemsRemovedNode.NodeType == NodeType.Object) { foreach (var aNode in ItemsRemovedNode.LoopObject()) { ActionEnergy.Add(aNode.Key, aNode.Value.GetAs <int>()); } } RoamingJobSettings = RoamingJobManager.GetCallbacks(RoamObjective); Initialize(); }