/// <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);
 }
示例#2
0
 public PlayerTank(Opponent player, int tankX, int tankY, Gameplay game)
 {
     //Alex Holm N9918205
     TX              = tankX;
     TY              = tankY;
     current_player  = player;
     current_game    = game;
     current_chassis = current_player.GetTank();
     startingArmour  = current_chassis.GetTankHealth();
     angle           = 0;
     power           = 25;
     current_weapon  = GetPlayerWeapon();
     AimTurret(GetAngle());
     armour       = current_chassis.GetTankHealth();
     colour       = current_player.GetColour();
     current_tBMP = current_chassis.CreateTankBitmap(colour, angle);
 }
        /// <summary>
        /// Creates a BattleTank with the passed information
        /// Setting the colour with GetColour()
        /// Durability with GetTankArmour();
        /// TankModel with GetTank();
        /// Author Greyden Scott & Sean O'Connell October 2017
        /// Written, edited and tested by both team members
        /// </summary>
        /// <param name="player">The player associated with the Battle Tanks</param>
        /// <param name="tankX">The X Position</param>
        /// <param name="tankY">The Y position</param>
        /// <param name="game">Current games</param>
        /// <returns>explanation of return value</returns>
        public BattleTank(Opponent player, int tankX, int tankY, Gameplay game)
        {
            this.player = player;
            this.tankX  = tankX;
            this.tankY  = tankY;

            tankModel      = player.GetTank();
            currDurability = tankModel.GetTankArmour();

            angle       = 0;
            power       = 25;
            curr_weapon = 0;

            plColour = player.GetColour();

            tankBmp = tankModel.CreateBMP(plColour, angle);

            this.game = game;
        }
 /// <summary>
 /// Returns the TankModel assocaited with the BattleTank
 /// Author Greyden Scott & Sean O'Connell October 2017
 /// Written, edited and tested by both team members
 /// </summary>
 /// <returns>Returns the TankModel of the BattleTank</returns>
 public TankModel GetTank()
 {
     return(player.GetTank());
 }
示例#5
0
 public Chassis GetTank()
 {
     //Alex Holm N9918205
     return(current_player.GetTank());
 }