Exemple #1
0
        public FreeActor(Actor self, FreeActorInfo info)
        {
            self.World.AddFrameEndTask(
                w =>
                {
                    var a = w.CreateActor(info.Actor, new TypeDictionary
                    {
                        new LocationInit( self.Location + (CVec)info.SpawnOffset ),
                        new OwnerInit( self.Owner ),
                        new FacingInit( info.Facing ),
                    });

                    if (info.InitialActivity != null)
                        a.QueueActivity(Game.CreateObject<Activity>(info.InitialActivity));
                });
        }
Exemple #2
0
        public FreeActor(Actor self, FreeActorInfo info)
        {
            self.World.AddFrameEndTask(
                w =>
            {
                var a = w.CreateActor(info.Actor, new TypeDictionary
                {
                    new LocationInit(self.Location + (CVec)info.SpawnOffset),
                    new OwnerInit(self.Owner),
                    new FacingInit(info.Facing),
                });

                if (info.InitialActivity != null)
                {
                    a.QueueActivity(Game.CreateObject <Activity>(info.InitialActivity));
                }
            });
        }
Exemple #3
0
        public FreeActor(ActorInitializer init, FreeActorInfo info)
        {
            if (init.Contains <FreeActorInit>() && !init.Get <FreeActorInit>().value)
            {
                return;
            }

            init.self.World.AddFrameEndTask(w =>
            {
                var a = w.CreateActor(info.Actor, new TypeDictionary
                {
                    new ParentActorInit(init.self),
                    new LocationInit(init.self.Location + (CVec)info.SpawnOffset),
                    new OwnerInit(init.self.Owner),
                    new FacingInit(info.Facing),
                });

                if (info.InitialActivity != null)
                {
                    a.QueueActivity(Game.CreateObject <Activity>(info.InitialActivity));
                }
            });
        }