public object ReceiveShipDestinationReached(MessageAgentDestinationReached msg)
 {
     if (isPilotingShip())
     {
         _currentState = InternalAgentState.PilotingAwaitingDockingResponse;
         //_actorTextOutput.Tell("Agent Requesting dock from " + StarChart.GetPlanet(_memory.CurrentDestinationScId).Name);
         return new MessageShipCommand(new MessageShipBasic(ShipCommandEnum.Dock), msg.TickSent, _model.CurrentShipId);
     }
     return null;
 }
 public void ReceiveShipResponse(MessageShipResponse msg)
 {
     if (msg.SentCommand.Command.CommandType == ShipCommandEnum.Undock)
     {
         if (msg.Response == true)
         {
             _currentState = InternalAgentState.Piloting;
             //_actorTextOutput.Tell("Agent Undock Granted");
         }
         else
         {
             _currentState = InternalAgentState.PilotingDockedShip;
         }
     }
     else if (msg.SentCommand.Command.CommandType == ShipCommandEnum.Dock)
     {
         if (msg.Response == true)
         {
             _currentState = InternalAgentState.PilotingDockedShip;
             //_actorTextOutput.Tell("Agent Dock Granted");
             _memory.CurrentDestinationScId = 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;
            }
        }
 private object pilotingDockedShip(MessageTick tick)
 {
     if (isPilotingShip())
     {
         setNewDestinationFromDocked();
         _currentState = InternalAgentState.PilotingAwaitingUndockingResponse;
         //_actorTextOutput.Tell("Agent Requesting Undock from " + _currentShip.DockedPlanet.Name);
         return new MessageShipCommand(new MessageShipBasic(ShipCommandEnum.Undock), tick.Tick, _model.CurrentShipId);
     }
     return null;
 }