Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // lib/openxum-core/games/emergo/engine.mjs
- import OpenXum from '../../openxum/index.mjs';
- //import les autres classes dont vous avez besoin
- class Engine extends OpenXum.Engine {
- constructor(t, c) {
- super();
- this._type = t;
- this._current_color = c;
- // autres attributs nécessaires à votre jeu
- }
- build_move() {
- return new Move();
- }
- clone() {
- let o = new Engine(this._type, this._current_color);
- o._attribute = this._attribute;
- // ...
- return o;
- // TODO
- }
- current_color() {
- return this._current_color;
- //TODO
- }
- get_name() {
- return 'Newgame';
- // TODO
- }
- get_possible_move_list() {
- // TODO
- }
- is_finished() {
- // TODO
- }
- move(move) {
- if (move.get_type() === MoveType.PUT_PIECE) {
- this._put_piece(move);
- } if (move.get_type() === MoveType.MOVE_STACK) {
- this._move_piece(move);
- }
- }
- parse(str) {
- // TODO
- }
- to_string() {
- // TODO
- }
- winner_is() {
- // TODO
- }
- }
- export default Engine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement