コード例 #1
0
        public fleet()
        {
            Robots Maximus = new Robots("Maximus", 100, 160, "Laser", 50);
            Robots Primus  = new Robots("Primus", 100, 150, "Cannon", 20);
            Robots Ultima  = new Robots("Ultima", 100, 120, "Sword", 25);

            //Maximus AttackPower is equal to 50 points
            //Primus Attack Power is equal to 20 points
            //Ultima Attack Power is equal to 25 points
            robots.Add(Maximus);
            robots.Add(Primus);
            robots.Add(Ultima);
        }
コード例 #2
0
 public void Attack(Robots robo)
 {
     robo.Health -= AttackPower;
 }
コード例 #3
0
        //methods can do
        //attack if something
        //dodge if something
        //died

        public void AttackRobot(Robots robots)
        {
            robots.health -= attackPower;
        }