public WeaponsLogic( TargetingInfo effectsWho, EffectCollection effectCollection) { this.effectsWho = effectsWho; this.effectCollection = effectCollection; }
public MultipleHitWeaponsLogic( TargetingInfo effectsWho, EffectCollection effectCollection, Bounded <float> damageDelay) : base(effectsWho, effectCollection) { this.damageDelay = damageDelay; this.didCollision = false; }
private Predicate <IControlable> CreatePredicate(TargetingInfo targetingInfo) { return (delegate(IControlable possibleTarget) { return possibleTarget.IsTargetable && targetingInfo.MeetsRequirements(FactionInfo.GetTargetingType(host, possibleTarget)); // GetTargetingType(possibleTarget)); }); }
public WeaponsLogic(WeaponsLogic copy) { this.effectCollection = new EffectCollection(copy.effectCollection); this.actionSource = copy.actionSource; this.source = copy.source; this.parentWeapon = copy.parentWeapon; this.target = copy.target; this.factionInfo = copy.factionInfo; this.effectsWho = copy.effectsWho; this.host = copy.host; this.solidHost = copy.solidHost; }
public void OnCreation(IShip source, IWeaponsLogic weaponInfo) { this.weaponInfo = weaponInfo; foreach (IEffect effect in effects) { effect.OnCreation(weaponInfo); effectsWho = TargetingInfo.Merge(effectsWho, effect.EffectsWho); } foreach (IProlongedEffect prolongedEffect in prolongedEffects) { prolongedEffect.OnCreation(weaponInfo); effectsWho = TargetingInfo.Merge(effectsWho, prolongedEffect.EffectsWho); } }
public EffectCollection(EffectCollection copy) { this.effects = new List <IEffect>(copy.effects.Count); this.prolongedEffects = new List <IProlongedEffect>(copy.prolongedEffects.Count); this.effectsWho = copy.effectsWho; this.weaponInfo = copy.weaponInfo; this.attachmentFlags = copy.attachmentFlags; foreach (IEffect effect in copy.effects) { this.effects.Add((IEffect)effect.Clone()); } foreach (IProlongedEffect prolongedEffect in copy.prolongedEffects) { this.prolongedEffects.Add((IProlongedEffect)prolongedEffect.Clone()); } }
public virtual void OnCreation(GameResult gameResult, IWeapon host, IShip source, IAction actionSource) { this.host = host; this.source = source; this.actionSource = actionSource; this.target = actionSource.Target; this.parentWeapon = null; if (source != null) { this.factionInfo = new FactionInfo(source.FactionInfo); } else { this.factionInfo = new FactionInfo(solidHost.FactionInfo); } this.effectCollection.OnCreation(source, this); this.effectsWho = TargetingInfo.Merge(effectsWho, effectCollection.EffectsWho); }
public IControlable Next(TargetingInfo targetingInfo) { return(Next(CreatePredicate(targetingInfo))); }
public IControlable NextClosest(TargetingInfo targetingInfo, Vector2D location) { return(NextClosest( CreatePredicate(targetingInfo), location)); }