Esempio n. 1
0
        /// <summary>
        /// Designated constructor
        /// </summary>
        /// <param name="rotation">Angle setter</param>
        /// <param name="bColor">Color of body canon</param>
        /// <param name="location">Location of the canon</param>
        public BG_Cannon(float rotation, Color bColor, BG_Location location)
        {
            this.Rotation = rotation;
            this.Location = location;

            this.BobyBrush          = new SolidBrush(bColor);
            this.defaultCannonBrush = new SolidBrush(Color.Black);
            this.defaultBulletBrush = new SolidBrush(Color.Gray);

            this.BodySize   = new Size(DEFAULT_BODY_SIZE_X, DEFAULT_BODY_SIZE_Y);
            this.CannonSize = new Size(DEFAULT_CANNON_SIZE_X, DEFAULT_CANNON_SIZE_Y);

            this.RecBody          = new Rectangle(Location.PosX, Location.PosY, this.BodySize.Width, this.BodySize.Height);
            this.RecCannon        = new Rectangle(new Point(0, 0), this.CannonSize);
            this.permissionToFire = false;
        }
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="bColor">Color of body canon</param>
 /// <param name="location">Location of the canon</param>
 public BG_Cannon(Color bColor, BG_Location location)
     : this(DEFAULT_ROTATION, bColor, location)
 {
     //no code
 }
Esempio n. 3
0
 // Designated constructor
 public BG_Hit(BG_Location location, BG_Cannon cannon)
 {
     this.Location = location;
     this.Cannon   = cannon;
 }
Esempio n. 4
0
 /// <summary>
 /// Move the canon to another position
 /// </summary>
 /// <param name="location">New Position</param>
 public void Move(BG_Location location)
 {
     this.Location = location;
 }
Esempio n. 5
0
 public void MoveCannon(BG_Location location)
 {
     this.Cannon.Move(location);
 }