Пример #1
0
        public virtual void ReducePilots(float chance)
        {
            var dockedShips = new List <Ship>();

            foreach (var s in IncludedShips)
            {
                if (StrategyGame.RandomChance(chance))
                {
                    s.OrderShip(new DockOrder(_game, s));
                    LogOrder();
                    dockedShips.Add(s);
                }
            }
            if (dockedShips.Count > 0)
            {
                IncludedShips.RemoveAll(dockedShips.Contains);
            }
        }
Пример #2
0
        public virtual void UpdateMission()
        {
            IncludedShips.RemoveAll(_ => !_.Active);
            var cutOffTime = DateTime.Now.AddSeconds(_recentOrderDelaySecs);

            RecentOrders.RemoveAll(_ => _ > cutOffTime);

            var stillCompleted = MissionComplete();

            if (stillCompleted && !_completed)
            {
                _completed = true;
                IncludedShips.ForEach(_ => _.OrderShip(new DockOrder(_game, _)));
                IncludedShips.Clear();
            }
            else if (_completed && !stillCompleted)
            {
                _completed = false;
            }
        }