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 Tick(MessageTick tick) { if (_model.ShipState == ShipStateEnum.SpaceCruising && _model.DestinationScId != 0) { // move ship towards destination PointD newPoint = NavigationUtils.GetNewPointForShip(_model.Type.MaxCruisingSpeedKmH, _model.PositionX, _model.PositionY, _destination.PositionX, _destination.PositionY); _model.PositionX = newPoint.X; _model.PositionY = newPoint.Y; if (_model.PositionX == _destination.PositionX && _model.PositionY == _destination.PositionY) { // we are at our destination. MessageAgentDestinationReached msg = new MessageAgentDestinationReached(tick.Tick); _solarSystemC.SendMessageToAgent(_model.Pilot.AgentId, msg); } } }
private void receiveShipDestinationReached(MessageAgentDestinationReached msg) { Object message = _agentC.ReceiveShipDestinationReached(msg); if (message != null) Sender.Tell(message); }