public GpsDotEffect(Actor actor, GpsDotInfo info)
        {
            this.actor = actor;
            this.info  = info;
            anim       = new Animation(actor.World, info.Image);
            anim.PlayRepeating(info.String);

            visibility          = actor.Trait <IDefaultVisibility>();
            visibilityModifiers = actor.TraitsImplementing <IVisibilityModifier>().ToArray();

            dotStates = new PlayerDictionary <DotState>(actor.World,
                                                        p => new DotState(actor, p.PlayerActor.Trait <GpsWatcher>(), p.PlayerActor.TraitOrDefault <FrozenActorLayer>()));
        }
예제 #2
0
파일: GpsDot.cs 프로젝트: cjshmyr/OpenRA
        public GpsDot(Actor self, GpsDotInfo info)
        {
            this.self = self;
            this.info = info;
            anim      = new Animation(self.World, info.Image);
            anim.PlayRepeating(info.String);

            self.World.AddFrameEndTask(w => w.Add(this));

            huf      = Exts.Lazy(() => self.TraitOrDefault <HiddenUnderFog>());
            fuf      = Exts.Lazy(() => self.TraitOrDefault <FrozenUnderFog>());
            disguise = Exts.Lazy(() => self.TraitOrDefault <Disguise>());
            cloak    = Exts.Lazy(() => self.TraitOrDefault <Cloak>());

            frozen    = new Cache <Player, FrozenActorLayer>(p => p.PlayerActor.Trait <FrozenActorLayer>());
            dotStates = new PlayerDictionary <DotState>(self.World, player => new DotState(player.PlayerActor.Trait <GpsWatcher>()));
        }