Example #1
0
        private int rofDelta; // milliseconds

        #endregion Fields

        #region Constructors

        // ---- Constructors ----
        public Gun(string name, double mass, int caliber, int rateOfFire, Belt belt)
            : base(name, mass)
        {
            this.RateOfFire = rateOfFire;
            this.Belt = belt;
            this.currentRound = 0;
            this.cooldown = 0;
        }
Example #2
0
 public void Reload(Belt belt)
 {
     if (belt.Caliber == Caliber) {
         this.Belt = belt;
         this.currentRound = 0;
         this.cooldown = 0;
     } else {
         throw new Exception("Incorrect belt caliber");
     }
 }