Пример #1
0
        /* isp RemoveFormation()
         *
         * Input variables:
         * battleFormation =
         *
         * State variables:
         *
         *
         */
        public void RemoveFormation(BattleFormation battleFormation)
        {
            if (battleFormation is null)
            {
                throw new ArgumentNullException(nameof(BattleFormation));
            }

            var formations = Formations.Where(f => f.Equals(battleFormation));

            if (formations == null || formations.Count() == 0)
            {
                throw new ArgumentException("Battle formation does not exist");
            }

            Formations.Remove(battleFormation);
        }