本文整理汇总了Python中book.Book.processMessage方法的典型用法代码示例。如果您正苦于以下问题:Python Book.processMessage方法的具体用法?Python Book.processMessage怎么用?Python Book.processMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类book.Book
的用法示例。
在下文中一共展示了Book.processMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GatewayCollection
# 需要导入模块: from book import Book [as 别名]
# 或者: from book.Book import processMessage [as 别名]
speed = 1
nextMove = time.time() + speed
##game = chessgame.ChessGame(gameId = 150, result = "1/2-1/2", moves="e4 c5 Nf3 e6 d4 cxd4 Nxd4 a6 Bd3 Nf6 O-O Qc7 Qe2 d6 c4 g6 Nc3 Bg7 Nf3 O-O Bf4 Nc6 Rac1 e5 Bg5 h6 Be3 Bg4 Nd5 Qd8 h3 Nxd5 cxd5 Nd4 Bxd4 Bxf3 Qxf3 exd4 Rc4 Rc8 Rfc1 Rxc4 Rxc4 h5 Qd1 Be5 Qc1 Qf6 Rc7 Rb8 a4 Kg7 b4 h4 Kf1 Bf4 Qd1 Qd8 Rc4 Rc8 a5 Rxc4 Bxc4 Qf6 Be2 Be5 Bf3 Qd8 Qc2 b6 axb6 Qxb6 Qc4 d3".split(" "))
game = chessgame.ChessGame.fromstr(gamelines.pop(0))
n = 0
debugFeedBook = True
gateways = GatewayCollection()
f = feed.Feed(send=True)
b = MatchingBook()
newMsg = game.newMessage()
f.send(newMsg)
if debugFeedBook:
fb = Book()
fb.processMessage(newMsg)
r = RecoveryBuilder(b,f)
pnlEvents = pnl.PnlEvents(pnlFilename)
oldMark = None
newoid = 1
while True:
if time.time() > nextMove:
if n < len(game.moves):
moveMessage = game.moveMessage(n)
log.info("moveMessage = '%s'" % moveMessage)
f.send(moveMessage)
n += 1
else:
resultMsg = game.resultMessage()
settlePrice = 100 if resultMsg.whiteWins() else 0