/// <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; }
/// <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 }
/// <summary> /// Move the canon to another position /// </summary> /// <param name="location">New Position</param> public void Move(BG_Location location) { this.Location = location; }