コード例 #1
0
 protected override void RemoveFiredOrdnanceFromRecord(IOrdnance ordnance) {
     var isRemoved = _activeFiredOrdnance.Remove(ordnance as ITerminatableOrdnance);
     D.Assert(isRemoved);
 }
コード例 #2
0
ファイル: BeamProjector.cs プロジェクト: Maxii/CodeEnv.Master
 protected override void RemoveFiredOrdnanceFromRecord(IOrdnance terminatedOrdnance) {
     D.AssertEqual(_activeOrdnance, terminatedOrdnance);
     _activeOrdnance = null;
 }
コード例 #3
0
 protected override void RecordFiredOrdnance(IOrdnance ordnanceFired) {
     _activeFiredOrdnance.Add(ordnanceFired as ITerminatableOrdnance);
 }
コード例 #4
0
ファイル: BeamProjector.cs プロジェクト: Maxii/CodeEnv.Master
 protected override void RecordFiredOrdnance(IOrdnance ordnanceFired) {
     D.AssertNull(_activeOrdnance);
     _activeOrdnance = ordnanceFired as ITerminatableOrdnance;
 }
コード例 #5
0
ファイル: BeamProjector.cs プロジェクト: Maxii/CodeEnv.Master
 public override void HandleFiringComplete(IOrdnance ordnanceFired) {
     base.HandleFiringComplete(ordnanceFired);
     // IMPROVE Stop tracking target with turret
 }
コード例 #6
0
ファイル: BeamProjector.cs プロジェクト: Maxii/CodeEnv.Master
 public override void HandleFiringInitiated(IElementAttackable targetFiredOn, IOrdnance ordnanceFired) {
     base.HandleFiringInitiated(targetFiredOn, ordnanceFired);
     // IMPROVE Track target with turret
 }
コード例 #7
0
ファイル: AWeapon.cs プロジェクト: Maxii/CodeEnv.Master
 /// <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);
コード例 #8
0
ファイル: AWeapon.cs プロジェクト: Maxii/CodeEnv.Master
 /// <summary>
 /// Records the provided ordnance as having been fired.
 /// </summary>
 /// <param name="ordnanceFired">The ordnance fired.</param>
 protected abstract void RecordFiredOrdnance(IOrdnance ordnanceFired);
コード例 #9
0
ファイル: AWeapon.cs プロジェクト: Maxii/CodeEnv.Master
 /// <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();
 }
コード例 #10
0
ファイル: AWeapon.cs プロジェクト: Maxii/CodeEnv.Master
        /// <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();
        }