示例#1
0
  @Given("^'(\\w+)' has a Start script$")
  public void object_has_start_script(String object) {
    programWaitLockPermits -= 1;
    Project project = ProjectManager.getInstance().getCurrentProject();
    Sprite sprite = Util.findSprite(project, object);
    StartScript script = new StartScript(sprite);

    script.addBrick(
        new CallbackBrick(
            sprite,
            new CallbackBrick.BrickCallback() {
              @Override
              public void onCallback() {
                synchronized (programStartWaitLock) {
                  if (!programHasStarted) {
                    programHasStarted = true;
                    programStartWaitLock.notify();
                  }
                }
              }
            }));

    sprite.addScript(script);
    Cucumber.put(Cucumber.KEY_CURRENT_SCRIPT, script);
  }
示例#2
0
  @Given("^'(\\w+)' has a When '(\\w+)' script$")
  public void object_has_a_when_script(String object, String message) {
    programWaitLockPermits -= 1;
    Project project = ProjectManager.getInstance().getCurrentProject();
    Sprite sprite = Util.findSprite(project, object);
    BroadcastScript script = new BroadcastScript(sprite, message);

    sprite.addScript(script);
    Cucumber.put(Cucumber.KEY_CURRENT_SCRIPT, script);
  }