本文整理汇总了Python中service.Service.state方法的典型用法代码示例。如果您正苦于以下问题:Python Service.state方法的具体用法?Python Service.state怎么用?Python Service.state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类service.Service
的用法示例。
在下文中一共展示了Service.state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: inc_tick
# 需要导入模块: from service import Service [as 别名]
# 或者: from service.Service import state [as 别名]
self.service = None
self.command_buffer = []
self.clients = []
def inc_tick(self):
self.service.inc_tick()
from twisted.internet import reactor
reactor.callLater(TICK_DURATION, self.inc_tick)
#print "Tick %d" % service.tick
for client in self.clients:
client.send_commands(self.command_buffer)
self.command_buffer = []
if __name__ == '__main__':
f = AppFactory()
service = Service()
import character, game_state
game = game_state.GameState()
game.characters[0] = character.Character('john')
game.house.floors[0].add_walls([t for t in zip(zip([2]*5, range(5)), zip([3]*5, range(5)))])
service.state = game
f.service = service
from twisted.internet import reactor
reactor.listenTCP(9999, f)
reactor.callWhenRunning(f.inc_tick)
reactor.run()