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)); }
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)); }
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)); }