Exemple #1
0
        public TechBunker(ActorInitializer init, TechBunkerInfo info)
            : base(init, info)
        {
            this.info = info;

            withSpriteBody = init.Self.Trait <WithSpriteBody>();
            renderSprites  = init.Self.Trait <RenderSprites>();

            contains = init.Self.World.WorldActor.Trait <TechBunkerContains>();
            usage    = init.Self.World.WorldActor.Trait <TechBunkerUsage>();
            uses     = init.Self.World.WorldActor.Trait <TechBunkerUses>();

            AddAnimation(init.Self, info.SequenceLocked, () => State != TechBunkerState.ClosedLocked);
            AddAnimation(init.Self, info.SequenceUnlocked, () => State == TechBunkerState.ClosedLocked);
        }
Exemple #2
0
        public TechBunker(ActorInitializer init, TechBunkerInfo info)
            : base(init, info)
        {
            this.info = info;

            this.withSpriteBody = init.Self.TraitOrDefault <WithSpriteBody>();
            this.renderSprites  = init.Self.TraitOrDefault <RenderSprites>();

            this.contains = init.Self.World.WorldActor.TraitOrDefault <TechBunkerContains>();
            this.usage    = init.Self.World.WorldActor.TraitOrDefault <TechBunkerUsage>();
            this.uses     = init.Self.World.WorldActor.TraitOrDefault <TechBunkerUses>();

            if (info.SequenceLocked != null)
            {
                this.AddAnimation(init.Self, info.SequenceLocked, () => this.State != TechBunkerState.ClosedLocked);
            }

            if (info.SequenceUnlocked != null)
            {
                this.AddAnimation(init.Self, info.SequenceUnlocked, () => this.State == TechBunkerState.ClosedLocked);
            }
        }