public AgentDefaultController(AgentControllerState ag, IActorRef actorSolarSystem, IActorRef actorTextOutput) { _state = ag; _actorSolarSystem = actorSolarSystem; _actorTextOutput = actorTextOutput; _goapAgent = new GoapAgent(this, this, _state); _memory = JsonConvert.DeserializeObject <AgentDefaultMemory>(_state.Memory); if (_memory == null) { _memory = new AgentDefaultMemory(); } }
private void setupInitialStateFromModel() { _memory = JsonConvert.DeserializeObject<AgentDefaultMemory>(_model.Memory); if (_memory == null) _memory = new AgentDefaultMemory(); if (isPilotingShip()) { if (_model.CurrentShipState == ShipStateEnum.Docked) _currentState = InternalAgentState.PilotingDockedShip; else if (_model.CurrentShipState == ShipStateEnum.SpaceCruising) _currentState = InternalAgentState.Piloting; } else { _currentState = InternalAgentState.Planetside; } }