Example #1
0
 protected override void RemoveFiredOrdnanceFromRecord(IOrdnance ordnance) {
     var isRemoved = _activeFiredOrdnance.Remove(ordnance as ITerminatableOrdnance);
     D.Assert(isRemoved);
 }
Example #2
0
 protected override void RemoveFiredOrdnanceFromRecord(IOrdnance terminatedOrdnance) {
     D.AssertEqual(_activeOrdnance, terminatedOrdnance);
     _activeOrdnance = null;
 }
Example #3
0
 protected override void RecordFiredOrdnance(IOrdnance ordnanceFired) {
     _activeFiredOrdnance.Add(ordnanceFired as ITerminatableOrdnance);
 }
Example #4
0
 protected override void RecordFiredOrdnance(IOrdnance ordnanceFired) {
     D.AssertNull(_activeOrdnance);
     _activeOrdnance = ordnanceFired as ITerminatableOrdnance;
 }
Example #5
0
 public override void HandleFiringComplete(IOrdnance ordnanceFired) {
     base.HandleFiringComplete(ordnanceFired);
     // IMPROVE Stop tracking target with turret
 }
Example #6
0
 public override void HandleFiringInitiated(IElementAttackable targetFiredOn, IOrdnance ordnanceFired) {
     base.HandleFiringInitiated(targetFiredOn, ordnanceFired);
     // IMPROVE Track target with turret
 }
Example #7
0
 /// <summary>
 /// Removes the fired ordnance from the record as having been fired.
 /// </summary>
 /// <param name="terminatedOrdnance">The dead ordnance.</param>
 protected abstract void RemoveFiredOrdnanceFromRecord(IOrdnance terminatedOrdnance);
Example #8
0
 /// <summary>
 /// Records the provided ordnance as having been fired.
 /// </summary>
 /// <param name="ordnanceFired">The ordnance fired.</param>
 protected abstract void RecordFiredOrdnance(IOrdnance ordnanceFired);
Example #9
0
 /// <summary>
 /// Called when this weapon's firing process launching the provided ordnance is complete. Projectile
 /// and Missile Weapons initiate and complete the firing process at the same time. Beam Weapons
 /// don't complete the firing process until their Beam is terminated.
 /// </summary>
 /// <param name="ordnanceFired">The ordnance fired.</param>
 public virtual void HandleFiringComplete(IOrdnance ordnanceFired) {
     D.Assert(!_isLoaded);
     //D.Log(ShowDebugLog, "{0}.HandleFiringComplete({1}) called.", DebugName, ordnanceFired.Name);
     IsFiringSequenceUnderway = false;
     InitiateReloadCycle();
 }
Example #10
0
        /// <summary>
        /// Called by the weapon's ordnance when this weapon's firing process against <c>targetFiredOn</c> has begun.
        /// </summary>
        /// <param name="targetFiredOn">The target fired on.</param>
        /// <param name="ordnanceFired">The ordnance fired.</param>
        public virtual void HandleFiringInitiated(IElementAttackable targetFiredOn, IOrdnance ordnanceFired) {
            if (!IsOperational) {
                D.Error("{0} fired at {1} while not operational.", Name, targetFiredOn.DebugName);
            }

            if (!_qualifiedEnemyTargets.Contains(targetFiredOn)) {
                D.Error("{0} fired at {1} but not in list of targets.", Name, targetFiredOn.DebugName);
            }

            //D.Log(ShowDebugLog, "{0}.HandleFiringInitiated(Target: {1}, Ordnance: {2}) called.", DebugName, targetFiredOn.DebugName, ordnanceFired.Name);
            RecordFiredOrdnance(ordnanceFired);
            ordnanceFired.deathOneShot += OrdnanceDeathEventHandler;

            RecordShotFired(targetFiredOn);

            _isLoaded = false;
            AssessReadiness();
        }