当前位置: 首页>>代码示例>>Python>>正文


Python Objects.get_client方法代码示例

本文整理汇总了Python中objects.Objects.get_client方法的典型用法代码示例。如果您正苦于以下问题:Python Objects.get_client方法的具体用法?Python Objects.get_client怎么用?Python Objects.get_client使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在objects.Objects的用法示例。


在下文中一共展示了Objects.get_client方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: server_build_unit

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def server_build_unit(self, pid, tid, vid, uid,buid):        
     # print "building unit", pid, tid, vid, uid
     client = Objects.get_client()
     player = client.players[pid]
     if uid not in player.underConstruction.keys():
         client.build_unit(tid, player, vid=vid, uid=uid)
     return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:9,代码来源:client.py

示例2: server_on_attack

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def server_on_attack(self,tpid,tuid,val):
     # print "server_on_attack", tpid,tuid,val
     client = Objects.get_client()
     p = client.players[tpid]
     if tuid in p.units.keys():
         p.units[tuid].client_on_attack(val)
     return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:9,代码来源:client.py

示例3: server_start_game

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def server_start_game(self):
     '''
     The client stub that gets called when the server starts the game
     '''
     client = Objects.get_client()
     client._init_players()
     client.start_game()
     return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:10,代码来源:client.py

示例4: join_game

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def join_game(self):
     constants.MULTIPLAYER = True
     utils.play_sound("Enter.wav")
     c = Objects.get_client()
     c.start_server()  # start client server
     connection = c.server_connect()  # connect to game server
     if not connection:
         c.stop_server()
     menu_player.stop()
     self.game_started = True
开发者ID:david-abel,项目名称:noteworks,代码行数:12,代码来源:game.py

示例5: server_update_health

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def server_update_health(self, pid, uid, h, tid,vid):
     # print "update_health", pid, uid, h
     client = Objects.get_client()
     player = client.players[pid]
     if uid not in player.underConstruction.keys():
         unit = client.build_unit(tid,player,vid=vid,uid=uid)
     else:
         unit = player.underConstruction[uid]
     unit.health = h
     client._complete_build(unit, player, uid)
     return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:13,代码来源:client.py

示例6: server_animate_attack

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
    def server_animate_attack(self,pid,uid,tpid,tuid,path):
        #if no path, stop attacking
        # print "server_animate_attack",pid,uid, tpid,tuid,path
        client = Objects.get_client()

        if (uid in client.players[pid].units.keys()):
            attacker = client.players[pid].units[uid]
            if tpid == -1 or tuid == -1:
                attacker.end_attack(True)
            elif path:
                target = client.players[tpid].units[tuid]
                attacker.attackingPath = path
                if not attacker.is_attacking:
                    attacker.client_attack(target,client.map)
        return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:17,代码来源:client.py

示例7: client_remove_unit

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def client_remove_unit(self,pid,uid):
     # print "remove unit", pid, uid
     client = Objects.get_client()
     unit = client.players[pid].units[uid]
     unit.destroy_action()
     return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:8,代码来源:client.py

示例8: server_move_troop

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def server_move_troop(self, pid, uid, vid, path):
     # print "server move unit", pid, vid, uid, path
     client = Objects.get_client()
     path = client.move_unit(client.players[pid].units[uid], path)
     return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:7,代码来源:client.py

示例9: server_update_location

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def server_update_location(self, pid, uid, vid):
     client = Objects.get_client()
     p = client.players[pid]
     curVertex = client.map.vertices[str(vid)]
     client.update_location(p.units[uid], curVertex.position, curVertex)
     return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:8,代码来源:client.py

示例10: server_add_player

# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import get_client [as 别名]
 def server_add_player(self, pid):
     # print "server add player"
     client = Objects.get_client()
     client.playerList.append(pid)
     return {}
开发者ID:david-abel,项目名称:noteworks,代码行数:7,代码来源:client.py


注:本文中的objects.Objects.get_client方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。