コード例 #1
0
 // 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();
     }
 }
コード例 #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();
         }
     }
 }
コード例 #3
0
 public static void ExecuteCode(this IGml codeObject)
 {
     CodeUnit.Get(codeObject).Run();
 }
コード例 #4
0
 public ScriptFunction(string name, string code) : base(name, -1)
 {
     Code = code;
     Unit = CodeUnit.Get(this);
 }