コード例 #1
0
ファイル: ScriptRunner.java プロジェクト: soartech/simjr
  /**
   * Construct a new script engine. Each engine has its own global state that persists across calls
   * to run scripts.
   *
   * @param services
   */
  public ScriptRunner(ServiceManager services) {
    this.services = services;

    // If theres's console, install our own console
    final ConsoleManager consoleManager = services.findService(ConsoleManager.class);
    if (consoleManager != null) {
      consoleManager.addParticipant(new Console());
    }
  }
コード例 #2
0
 /**
  * Helper function to support scripting.
  *
  * @param services
  */
 public static EntityPrototypeDatabase findService(ServiceManager services) {
   return services.findService(EntityPrototypeDatabase.class);
 }