Пример #1
0
        public void Handle(IEvent @event)
        {
            if (_executionCount == 0)
            {
                _executionCount++;
                _communicator.Communicate(_warning);
            }
            else if (_executionCount == 1)
            {
                _executionCount = 0;

                bool   success = _navigator.CancelExpedition();
                string script  = success ? _complete : _error;

                _communicator.Communicate(script);
            }
        }
Пример #2
0
        public virtual void Handle(IEvent @event)
        {
            if (_navigator.ExpeditionStarted)
            {
                if (_navigator.ExpeditionComplete)
                {
                    _communicator.Communicate("I'll clear your earlier expedition.");
                    _navigator.CancelExpedition();
                }
                else
                {
                    _communicator.Communicate(_expeditionExists);
                    return;
                }
            }

            bool success;

            if (_detourPlanner.DetourPlanned)
            {
                success = _detourPlanner.ConfirmDetour();
            }
            else
            {
                IEnumerable <StarSystem> expeditionData = _userDataService.GetExpeditionData();
                success = _navigator.PlanExpedition(expeditionData);
            }

            if (!success)
            {
                _communicator.Communicate(_unableToPlot);
                return;
            }

            _playerStatus.SetExpeditionStart(DateTimeOffset.Now);
            CommunicateExpedition();
        }