public ProductionQueue( Actor self, Actor playerActor, ProductionQueueInfo info ) { this.self = self; this.Info = info; playerResources = playerActor.Trait<PlayerResources>(); PlayerPower = playerActor.Trait<PowerManager>(); Race = self.Owner.Country; Produceable = InitTech(playerActor); }
public ProductionQueue( Actor self, Actor playerActor, ProductionQueueInfo info ) { this.self = self; this.Info = info; PlayerResources = playerActor.Trait<PlayerResources>(); PlayerPower = playerActor.Trait<PowerManager>(); var ttc = playerActor.Trait<TechTree>(); foreach (var a in AllBuildables(Info.Type)) { var bi = a.Traits.Get<BuildableInfo>(); // Can our race build this by satisfying normal prereqs? var buildable = bi.Owner.Contains(self.Owner.Country.Race); Produceable.Add( a, new ProductionState(){ Visible = buildable && !bi.Hidden } ); if (buildable) ttc.Add( a.Name, a.Traits.Get<BuildableInfo>().Prerequisites.ToList(), this ); } }
public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info) { self = init.self; Info = info; playerResources = playerActor.Trait<PlayerResources>(); playerPower = playerActor.Trait<PowerManager>(); developerMode = playerActor.Trait<DeveloperMode>(); Race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Country.Race; Enabled = !info.Race.Any() || info.Race.Contains(Race); CacheProduceables(playerActor); }
public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info) { self = init.Self; Info = info; playerResources = playerActor.Trait<PlayerResources>(); playerPower = playerActor.Trait<PowerManager>(); developerMode = playerActor.Trait<DeveloperMode>(); Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName; Enabled = !info.Factions.Any() || info.Factions.Contains(Faction); CacheProducibles(playerActor); allProducibles = producible.Where(a => a.Value.Buildable || a.Value.Visible).Select(a => a.Key); buildableProducibles = producible.Where(a => a.Value.Buildable).Select(a => a.Key); }