aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/client/channel.py
diff options
context:
space:
mode:
authorPhilip Paquette <pcpaquette@gmail.com>2019-09-11 17:01:24 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-09-14 18:18:53 -0400
commit57c9c33ae756cc17af223f6bc671191684ee9c9b (patch)
tree048554a3f883ec2530c68eed20665d25caeaed57 /diplomacy/client/channel.py
parent8ca9bcfbad2b93e1466f290cf8d7eb82e3bf8146 (diff)
Renamed argument in channel methods from 'game_object' to 'game'
Diffstat (limited to 'diplomacy/client/channel.py')
-rw-r--r--diplomacy/client/channel.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/diplomacy/client/channel.py b/diplomacy/client/channel.py
index 146d5e3..2063272 100644
--- a/diplomacy/client/channel.py
+++ b/diplomacy/client/channel.py
@@ -46,24 +46,24 @@ def _req_fn(request_class, local_req_fn=None, **request_args):
for (key, value) in sorted(request_args.items()))) if request_args else ''
@gen.coroutine
- def func(self, game_object=None, **kwargs):
+ def func(self, game=None, **kwargs):
""" Send an instance of request_class with given kwargs and game object.
:param self: Channel object who sends the request.
- :param game_object: (optional) a NetworkGame object (required for game requests).
+ :param game: (optional) a NetworkGame object (required for game requests).
:param kwargs: request arguments.
:return: Data returned after response is received and handled by associated response manager.
See module diplomacy.client.response_managers about responses management.
- :type game_object: diplomacy.client.network_game.NetworkGame
+ :type game: diplomacy.client.network_game.NetworkGame
"""
kwargs.update(request_args)
if request_class.level == strings.GAME:
- assert game_object is not None
+ assert game is not None
kwargs[strings.TOKEN] = self.token
- kwargs[strings.GAME_ID] = game_object.game_id
- kwargs[strings.GAME_ROLE] = game_object.role
- kwargs[strings.PHASE] = game_object.current_short_phase
+ kwargs[strings.GAME_ID] = game.game_id
+ kwargs[strings.GAME_ROLE] = game.role
+ kwargs[strings.PHASE] = game.current_short_phase
else:
- assert game_object is None
+ assert game is None
if request_class.level == strings.CHANNEL:
kwargs[strings.TOKEN] = self.token
if local_req_fn is not None:
@@ -71,7 +71,7 @@ def _req_fn(request_class, local_req_fn=None, **request_args):
if local_ret is not None:
return local_ret
request = request_class(**kwargs)
- return (yield self.connection.send(request, game_object))
+ return (yield self.connection.send(request, game))
func.__request_name__ = request_class.__name__
func.__request_params__ = str_params