Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface definition needed #28

Open
d180cf opened this issue Jul 12, 2015 · 0 comments
Open

Interface definition needed #28

d180cf opened this issue Jul 12, 2015 · 0 comments

Comments

@d180cf
Copy link

d180cf commented Jul 12, 2015

Hello eidogo developers,

I'm writing a tsumego solving js library and found that eidogo can simplify my debugging experience: eidogo can render the search tree and help me understand where the algorithm chose a wrong way. Essentially I need from eidogo a few things:

  1. Render SGF.
  2. Move to the "current" node in the SGF.
  3. Play a move.
  4. Make a pass.
  5. Undo the move.

It's clear how to render SGF from the samples, but it doesn't seem so clear how to do the rest. Since I couldn't find an interface definition of eidogo, I had to see in debugger how the UI achieves what I need: I put a breakpoint in player.js, click on the board and see what happens. So far I've figured out that in order to play a move it does .playMove, .board.commit and .board.render: this seems to add the move, but doesn't update the game tree.

It would be nice to have the eidogo's interface in form of a TypeScript's .d.ts file:

declare module eidogo {
  interface Player {
    /** move = "ca", color = -1 (white) */
    playMove(move: string, color: number);
    board: {
      commit(): void;
      render(): void;
    }
  }
}

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant