Пример #1
0
 private void _CalcMaterialForSupply()
 {
     _fuel_for_supply = (_ammo_for_supply = 0);
     for (int i = 0; i < _checked_ships.Count; i++)
     {
         int       mem_id    = _checked_ships[i];
         ShipModel shipModel = _GetShipModel(mem_id);
         if (shipModel != null)
         {
             MaterialInfo resourcesForSupply = shipModel.GetResourcesForSupply();
             _fuel_for_supply += resourcesForSupply.Fuel;
             _ammo_for_supply += resourcesForSupply.Ammo;
         }
     }
 }
Пример #2
0
 private void _CalcMaterialForSupply()
 {
     this._fuel_for_supply = (this._ammo_for_supply = 0);
     for (int i = 0; i < this._checked_ships.get_Count(); i++)
     {
         int       mem_id    = this._checked_ships.get_Item(i);
         ShipModel shipModel = this._GetShipModel(mem_id);
         if (shipModel != null)
         {
             MaterialInfo resourcesForSupply = shipModel.GetResourcesForSupply();
             this._fuel_for_supply += resourcesForSupply.Fuel;
             this._ammo_for_supply += resourcesForSupply.Ammo;
         }
     }
 }
Пример #3
0
        private void _ToggleCheckStatus(int memId)
        {
            if (_checked_ships.Contains(memId))
            {
                _checked_ships.Remove(memId);
                return;
            }
            ShipModel shipModel = _GetShipModel(memId);

            if (shipModel != null)
            {
                MaterialInfo resourcesForSupply = shipModel.GetResourcesForSupply();
                if (resourcesForSupply.Fuel > 0 || resourcesForSupply.Ammo > 0)
                {
                    _checked_ships.Add(memId);
                }
            }
        }
Пример #4
0
 private CheckBoxStatus _GetCheckBoxStatus(ShipModel ship, DeckModel deck)
 {
     if (ship == null)
     {
         return(CheckBoxStatus.DISABLE);
     }
     if (ship.IsInMission() || ship.IsBling())
     {
         return(CheckBoxStatus.DISABLE);
     }
     if (ship.GetResourcesForSupply().HasPositive())
     {
         if (_checked_ships.IndexOf(ship.MemId) == -1)
         {
             return(CheckBoxStatus.OFF);
         }
         return(CheckBoxStatus.ON);
     }
     return(CheckBoxStatus.DISABLE);
 }