Ejemplo n.º 1
0
 /// <summary>
 ///
 /// This method sets the ControlledTank's current aiming angle.
 ///
 /// Author John Santias and Hoang Nguyen October 2017
 ///
 /// </summary>
 /// <param name="angle"> Sets the angle of the Controlled Tank </param>
 public void SetAimingAngle(float angle)
 {
     if (angle >= -90 && angle <= 180)
     {
         this.angle = (int)angle;
     }
     colour = tankModel.CreateBitmap(player.GetColour(), angle);
 }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// This constructor initializes a new instance of the ControlledTank class.
 /// It also stores the tankModel by usubg the Opponents GetTank() method, and
 /// GetArmour() for the current durability of the TankModel. In addition, it also
 /// stores the angle, power, current weapons and colour of the tank which is a bitmap.
 ///
 /// Author John Santias and Hoang Nguyen October 2017
 ///
 /// </summary>
 /// <param name="player"> A reference of Opponent stored as player </param>
 /// <param name="tankX"> The x coordinate of the tank </param>
 /// <param name="tankY"> The y coordinate of the tank </param>
 /// <param name="game"> A reference of Gameplay stored as game </param>
 public ControlledTank(Opponent player, int tankX, int tankY, Gameplay game)
 {
     this.player = player;
     this.tankX  = tankX;
     this.tankY  = tankY;
     this.game   = game;
     tankModel   = player.GetTank();
     currentDur  = tankModel.GetArmour();
     angle       = 0;
     power       = 25;
     tankWeapon  = 0;
     colour      = tankModel.CreateBitmap(player.GetColour(), angle);
 }