コード例 #1
0
 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();
     }
 }
コード例 #2
0
        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;
            }
        }