Beispiel #1
0
        public BaseEntity LoadEntity(ContentManager content, ScriptEntityDescription entity, Vector2 position)
        {
            if (entity.Factory != this)
            {
                throw new ArgumentException("Specified entity does not belong to this factory");
            }

            return(new LuaEntity(content, entity.File, position));
        }
Beispiel #2
0
        public BaseEntity LoadEntity(ContentManager content, ScriptEntityDescription entity, Vector2 position)
        {
            if (entity.Factory != this)
            {
                throw new ArgumentException("Specified entity does not belong to this factory");
            }

            var script = Engine.CreateScriptSourceFromFile(entity.File);
            var scope  = Engine.CreateScope();

            script.Execute(scope);

            dynamic entityClass = scope.GetVariable("ScriptEntity");

            return(entityClass(content, position));
        }
Beispiel #3
0
 public BaseEntity LoadEntity(ContentManager content, ScriptEntityDescription entity, Vector2 position)
 {
     return(null);
 }
 public BaseEntity LoadEntity(ContentManager content, ScriptEntityDescription entity, Vector2 position)
 {
     return(entity.Factory.LoadEntity(content, entity, position));
 }