Beispiel #1
0
        public Actor SpawnActor <T>(SlimMath.Vector3 position)
            where T : ActorDefinition
        {
            ActorDefinition definition;

            if (ActorDefinition.ByType(typeof(T), out definition))
            {
                return(spawnActor(null, Player.ServerPlayerId, definition.Id, position));
            }
            else
            {
                log.Warn("No actor definition of type {0} found", typeof(T));
                return(null);
            }
        }
Beispiel #2
0
        public Actor SpawnActor <T>(Player player, SlimMath.Vector3 position)
            where T : ActorDefinition
        {
            if (Verify.Authenticated(player))
            {
                ActorDefinition definition;

                if (ActorDefinition.ByType(typeof(T), out definition))
                {
                    return(spawnActor(player, player.Id, definition.Id, position));
                }
                else
                {
                    log.Warn("No actor definition of type {0} found", typeof(T));
                    return(null);
                }
            }

            return(null);
        }