Ejemplo n.º 1
0
        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>();
        }
Ejemplo n.º 2
0
        public PowerManager(Actor self, PowerManagerInfo info)
        {
            this.self = self;
            this.info = info;

            devMode        = self.Trait <DeveloperMode>();
            wasHackEnabled = devMode.UnlimitedPower;
        }
Ejemplo n.º 3
0
        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);
        }