protected override void RemoveFiredOrdnanceFromRecord(IOrdnance ordnance) { var isRemoved = _activeFiredOrdnance.Remove(ordnance as ITerminatableOrdnance); D.Assert(isRemoved); }
protected override void RemoveFiredOrdnanceFromRecord(IOrdnance terminatedOrdnance) { D.AssertEqual(_activeOrdnance, terminatedOrdnance); _activeOrdnance = null; }
protected override void RecordFiredOrdnance(IOrdnance ordnanceFired) { _activeFiredOrdnance.Add(ordnanceFired as ITerminatableOrdnance); }
protected override void RecordFiredOrdnance(IOrdnance ordnanceFired) { D.AssertNull(_activeOrdnance); _activeOrdnance = ordnanceFired as ITerminatableOrdnance; }
public override void HandleFiringComplete(IOrdnance ordnanceFired) { base.HandleFiringComplete(ordnanceFired); // IMPROVE Stop tracking target with turret }
public override void HandleFiringInitiated(IElementAttackable targetFiredOn, IOrdnance ordnanceFired) { base.HandleFiringInitiated(targetFiredOn, ordnanceFired); // IMPROVE Track target with turret }
/// <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);
/// <summary> /// Records the provided ordnance as having been fired. /// </summary> /// <param name="ordnanceFired">The ordnance fired.</param> protected abstract void RecordFiredOrdnance(IOrdnance ordnanceFired);
/// <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(); }
/// <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(); }