Ejemplo n.º 1
0
		public TSetPieceHandler(EPiece piece) {
			this.piece = piece;
		}
Ejemplo n.º 2
0
		public override void onPiecesChangedDelay(TSwitchesChangesEvent e) {
			base.onPiecesChangedDelay(e);

			for (var y = 0; y < 8; y++)
				for (var x = 0; x < 8; x++)
					if (e.oldSwitches[x, y] != e.newSwitches[x, y] && !e.newSwitches[x, y]) {
						piece = app.board[x, y].piece;
						app.board[x, y].piece = EPiece.none;
					}

			for (var y = 0; y < 8; y++)
				for (var x = 0; x < 8; x++)
					if (e.oldSwitches[x, y] != e.newSwitches[x, y] && e.newSwitches[x, y]) {
						app.board[x, y].piece = piece;
					}

			//if (e.state)
			//	app.board[e.pos].piece = piece;
			//else {
			//	piece = app.board[e.pos].piece;
			//	app.board[e.pos].piece = EPiece.none;
			//}

			//if (app.board.canSendToEngine()) {
			//	app.engine.position(app.board.toFEN());
			//	engine.debug();
			//}

			app.game.setBoard(app.board.toFEN());
		}