public WithIdleAnimation(Actor self, WithIdleAnimationInfo info) : base(info) { wsb = self.Trait <WithSpriteBody>(); buildComplete = !self.Info.HasTraitInfo <BuildingInfo>(); // always render instantly for units ticks = info.Interval; }
public WithMoveAnimation(ActorInitializer init, WithMoveAnimationInfo info) { this.info = info; movement = init.Self.Trait <IMove>(); wsb = init.Self.Trait <WithSpriteBody>(); cachedPosition = init.Self.CenterPosition; }
public Refinery(Actor self, RefineryInfo info) { this.self = self; this.info = info; playerResources = self.Owner.PlayerActor.Trait <PlayerResources>(); currentDisplayTick = info.TickRate; wsb = self.Trait <WithSpriteBody>(); }
public WithAttackAnimation(ActorInitializer init, WithAttackAnimationInfo info) { this.info = info; attack = init.Self.Trait <AttackBase>(); armament = init.Self.TraitsImplementing <Armament>() .Single(a => a.Info.Name == info.Armament); wsb = init.Self.Trait <WithSpriteBody>(); }
public WithResources(Actor self, WithResourcesInfo info) { this.info = info; rs = self.Trait <RenderSprites>(); wsb = self.Trait <WithSpriteBody>(); playerResources = self.Owner.PlayerActor.Trait <PlayerResources>(); var a = new Animation(self.World, rs.GetImage(self)); a.PlayFetchIndex(info.Sequence, () => playerResources.ResourceCapacity != 0 ? ((10 * a.CurrentSequence.Length - 1) * playerResources.Resources) / (10 * playerResources.ResourceCapacity) : 0); anim = new AnimationWithOffset(a, null, () => !buildComplete, 1024); rs.Add(anim); }
public WithMakeAnimation(ActorInitializer init, WithMakeAnimationInfo info) { this.info = info; var self = init.Self; wsb = self.Trait <WithSpriteBody>(); var building = self.TraitOrDefault <Building>(); if (building != null && !building.SkipMakeAnimation) { wsb.PlayCustomAnimation(self, info.Sequence, () => { building.NotifyBuildingComplete(self); }); } }
public WithSiloAnimation(ActorInitializer init, WithSiloAnimationInfo info) { this.info = info; wsb = init.Self.Trait <WithSpriteBody>(); playerResources = init.Self.Owner.PlayerActor.Trait <PlayerResources>(); }
public WithHarvestAnimation(ActorInitializer init, WithHarvestAnimationInfo info) { Info = info; harv = init.Self.Trait <Harvester>(); wsb = init.Self.Trait <WithSpriteBody>(); }
public WithBuildingPlacedAnimation(Actor self, WithBuildingPlacedAnimationInfo info) { this.info = info; wsb = self.Trait <WithSpriteBody>(); buildComplete = !self.Info.HasTraitInfo <BuildingInfo>(); }
public WithChargeAnimation(ActorInitializer init, WithChargeAnimationInfo info) { this.info = info; wsb = init.Self.Trait <WithSpriteBody>(); }
public WithActiveAnimation(Actor self, WithActiveAnimationInfo info) { wsb = self.Trait <WithSpriteBody>(); this.info = info; }