public LibraryModule() { LibraryClassAttribute attribute = (LibraryClassAttribute)Attribute.GetCustomAttribute(typeof(T), typeof(LibraryClassAttribute), false); InternalScriptType type = ScriptInterpreter.Interpreter.Programm.InternalTypes.Get(attribute.Name); _value = new ScriptObjectContext(type.Module, this); }
public IValue Type(IValue value) { InternalScriptType script_type = ScriptInterpreter.Interpreter.Programm.InternalTypes.Get(value.AsString()); if (script_type == null) { throw new Exception($"Тип [{value.ToString()}] не определен."); } return(ValueFactory.Create(script_type)); }
public IValue TypeOf(IValue value) { InternalScriptType script_type = value.ScriptType; if (script_type == null) { throw new Exception($"Тип [{value.ToString()}] не определен."); } return(ValueFactory.Create(script_type)); }
public void AttachScript(string path, string type_name) { ScriptModule module = new ScriptModule(type_name, type_name, ModuleTypeEnum.OBJECT, false, path); ScriptInterpreter.Interpreter.Programm.AttachScript(module); InternalScriptType type = new InternalScriptType() { Name = type_name, Alias = type_name, Module = module, }; ScriptInterpreter.Interpreter.Programm.InternalTypes.Add(type); }
public TypeValue(InternalScriptType value) { _value = value; }