Beyond_Beyaan.Fleet.SubtractShips C# (CSharp) Method

SubtractShips() public method

public SubtractShips ( Ship ship, int amount ) : void
ship Ship
amount int
return void
        public void SubtractShips(Ship ship, int amount)
        {
            if (ships.ContainsKey(ship))
            {
                if (amount == -1)
                {
                    //Remove this ship totally
                    ships.Remove(ship);
                    _orderedShips.Remove(ship);
                    UpdateSpeed();
                }
                else
                {
                    ships[ship] -= amount;
                }
            }
        }