// Execute a string. The string is cached, and subsequent calls of Exec() with the same code string
 //  execute code that is already compiled and cached. Code that is executed from a known location, i.e., a script,
 //  is recommended to have its own local code unit, so it does not have to be looked up in a table.
 public static void Exec(this RuntimeInstance i, string s)
 {
     using (new InstanceScope(i))
     {
         CodeUnit.Get(s).Run();
     }
 }
Beispiel #2
0
 public static void Init(this Room room)
 {
     if (room.CreationCode != null)
     {
         using (new InstanceScope(LibraryContext.Current.InstanceFactory.CreatePrivateInstance() as RuntimeInstance))
         {
             CodeUnit.Get(room).Run();
         }
     }
 }
Beispiel #3
0
 public static void ExecuteCode(this IGml codeObject)
 {
     CodeUnit.Get(codeObject).Run();
 }
Beispiel #4
0
 public ScriptFunction(string name, string code) : base(name, -1)
 {
     Code = code;
     Unit = CodeUnit.Get(this);
 }