public ProductionFromMapEdge(ActorInitializer init, ProductionInfo info) : base(init, info) { domainIndex = init.Self.World.WorldActor.Trait <DomainIndex>(); if (init.Contains <ProductionSpawnLocationInit>()) { spawnLocation = init.Get <ProductionSpawnLocationInit, CPos>(); } }
public ProductionFromMapEdge(ActorInitializer init, ProductionInfo info) : base(init, info) { domainIndex = init.Self.World.WorldActor.Trait <DomainIndex>(); var spawnLocationInit = init.GetOrDefault <ProductionSpawnLocationInit>(info); if (spawnLocationInit != null) { spawnLocation = spawnLocationInit.Value; } }
public WithProductionOverlay(Actor self, WithProductionOverlayInfo info) { var rs = self.Trait <RenderSprites>(); var body = self.Trait <BodyOrientation>(); buildComplete = !self.Info.HasTraitInfo <BuildingInfo>(); // always render instantly for units production = self.Info.TraitInfo <ProductionInfo>(); overlay = new Animation(self.World, rs.GetImage(self)); overlay.PlayRepeating(info.Sequence); var anim = new AnimationWithOffset(overlay, () => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))), () => !IsProducing || !buildComplete); rs.Add(anim, info.Palette, info.IsPlayerPalette); }
public Production(ActorInitializer init, ProductionInfo info) { Info = info; rp = Exts.Lazy(() => init.Self.IsDead ? null : init.Self.TraitOrDefault <RallyPoint>()); Faction = init.Contains <FactionInit>() ? init.Get <FactionInit, string>() : init.Self.Owner.Faction.InternalName; }
public Production(ActorInitializer init, ProductionInfo info) { Info = info; rp = Exts.Lazy(() => init.Self.IsDead ? null : init.Self.TraitOrDefault <RallyPoint>()); Race = init.Contains <RaceInit>() ? init.Get <RaceInit, string>() : init.Self.Owner.Country.Race; }