public ControlableWave( LifeSpan lifeTime, float mass, PhysicsState physicsState, float initialRadius, float expansionRate, int[] colors, int primaryColor, ShipMovementInfo movementInfo, ShipState shipState, FactionInfo factionInfo, ControlableSounds controlableSounds) : base( lifeTime, mass, physicsState, initialRadius, expansionRate) { this.shipState = shipState; this.movementInfo = movementInfo; this.factionInfo = factionInfo; this.controlableSounds = controlableSounds; this.attachedEffectCollection = new EffectCollection(); this.CollisionState.GenerateRayEvents = true; this.colors = colors; this.primaryColor = primaryColor; }
protected ControlableWave(ControlableWave copy) : base(copy) { this.Killed = Functions.Clone <EventHandler>(copy.Killed); this.shipState = new ShipState(copy.shipState); this.movementInfo = new ShipMovementInfo(copy.movementInfo); foreach (IControler controler in copy.controlers) { AddControler(null, (IControler)controler.Clone()); } this.target = copy.target; this.ControlHandler = Functions.Clone <IControlHandler>(copy.ControlHandler); this.currentControlInput = copy.currentControlInput; this.direction = copy.direction; this.controlableType = copy.controlableType; this.controlableSounds = copy.controlableSounds; this.attachedEffectCollection = new EffectCollection(copy.attachedEffectCollection); this.contFlags = copy.contFlags; this.CollisionState.GenerateRayEvents = true; this.colors = copy.colors; this.primaryColor = copy.primaryColor; if (copy.weaponInfo != null) { this.weaponInfo = (IWeaponsLogic)copy.weaponInfo.Clone(); } }
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; }
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 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 Controlable( LifeSpan lifeTime, PhysicsState physicsState, BodyFlags flags, RigidBodyTemplate template, ShipMovementInfo movementInfo, ShipState shipState, ControlableSounds controlableSounds) : base( lifeTime, physicsState, flags, template) { this.shipState = shipState; this.movementInfo = movementInfo; this.controlableSounds = controlableSounds; this.attachedEffectCollection = new EffectCollection(); this.CollisionState.GenerateRayEvents = true; }
public Controlable( LifeSpan lifeTime, MassInertia massInfo, PhysicsState physicsState, BodyFlags flags, ICollidableBodyPart[] collidableParts, ShipMovementInfo movementInfo, ShipState shipState, ControlableSounds controlableSounds) : base(lifeTime, massInfo, physicsState, flags, collidableParts) { this.shipState = shipState; this.movementInfo = movementInfo; this.controlableSounds = controlableSounds; this.attachedEffectCollection = new EffectCollection(); this.CollisionState.GenerateRayEvents = true; }
public void AttachEffects(EffectAttachmentResult attachmentResult, IControlable attachie, EffectCollection effectCollection) { if (effectCollection.CanEffect(attachie)) { attachmentResult.WeaponIsExpired = (effectCollection.attachmentFlags & EffectAttachmentFlags.WeaponExpires) == EffectAttachmentFlags.WeaponExpires; if ((effectCollection.attachmentFlags & EffectAttachmentFlags.ClonedAttachment) == EffectAttachmentFlags.ClonedAttachment) { foreach (IEffect effect in effectCollection.effects) { if (effect.CanEffect(attachie) && (!BlockEffect(effect))) { IEffect clone = (IEffect)effect.Clone(); clone.OnTargetAttachment(attachmentResult, attachie); effects.Add(clone); attachmentResult.EffectAttached = true; } } foreach (IProlongedEffect prolongedEffect in effectCollection.prolongedEffects) { if (prolongedEffect.CanEffect(attachie) && (!BlockEffect(prolongedEffect))) { IProlongedEffect clone = (IProlongedEffect)prolongedEffect.Clone(); clone.OnTargetAttachment(attachmentResult, attachie); prolongedEffects.Add(clone); attachmentResult.EffectAttached = true; } } } else { foreach (IEffect effect in effectCollection.effects) { if (effect.CanEffect(attachie) && (!BlockEffect(effect))) { effect.OnTargetAttachment(attachmentResult, attachie); effects.Add(effect); attachmentResult.EffectAttached = true; } } foreach (IProlongedEffect prolongedEffect in effectCollection.prolongedEffects) { if (prolongedEffect.CanEffect(attachie) && (!BlockEffect(prolongedEffect))) { prolongedEffect.OnTargetAttachment(attachmentResult, attachie); prolongedEffects.Add(prolongedEffect); attachmentResult.EffectAttached = true; } } } } }
public void AttachEffects(EffectAttachmentResult attachmentResult, EffectCollection effectCollection) { attachedEffectCollection.AttachEffects(attachmentResult, this, effectCollection); }