コード例 #1
0
        public string ManufactureTank(string name, double attackPoints, double defensePoints)
        {
            Tank tank = new Tank(name, attackPoints, defensePoints);

            if (this.machines.Contains(tank))
            {
                return(string.Format(OutputMessages.MachineExists, name));
            }

            tank.CalculatePoints();
            this.machines.Add(tank);

            string result = string.Format(OutputMessages.TankManufactured, name, tank.AttackPoints, tank.DefensePoints, tank.DefenseMode == true ? "ON" : "OFF");

            return(result);
        }