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