本文整理匯總了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