Inheritance: ITraitInfo
Ejemplo n.º 1
0
 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>();
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 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;
 }