Esempio n. 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));
        }
Esempio n. 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));
        }
Esempio n. 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));
 }