示例#1
0
 def move(self, ctx, x, y):
   piece = Piece(ctx.getBoard().getPlayer().getPieceColor())
   ctx.getBoard().addPiece(piece, x, y)
   movepdu = MovePDU()
   movepdu.setX(x)
   movepdu.setY(y)
   ctx.fgpclient.send(movepdu)
   ctx.getSignalEmitter().emitMove(x, y, piece.getColor())
   ctx.getSignalEmitter().emitStatusBarText("Waiting for move confirmation.")
   ctx.setState(WF_MOVE_CONFIRM())
   ctx.fgpclient.listen()