Exemplo n.º 1
0
        bool Free(MilitaryUnitType type, int amount)
        {
            var troop = GetTroop(type);

            if (amount <= 0 || troop == null || troop.count < amount)
            {
                return(false);
            }

            var success = Military.FreeFrom(ref troop, amount);

            if (!troop.deployed || troop.count == 0)
            {
                data.troops = data.troops.Where(t => t != troop).ToArray();
            }

            return(success);
        }