void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) { ClearQueue(); playerPower = newOwner.PlayerActor.Trait <PowerManager>(); playerResources = newOwner.PlayerActor.Trait <PlayerResources>(); developerMode = newOwner.PlayerActor.Trait <DeveloperMode>(); }
public PowerManager(Actor self, PowerManagerInfo info) { this.self = self; this.info = info; devMode = self.Trait <DeveloperMode>(); wasHackEnabled = devMode.UnlimitedPower; }
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; IsValidFaction = !info.Factions.Any() || info.Factions.Contains(Faction); Enabled = IsValidFaction; 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); }