Trade¶
- class src.trade.Trade(offering_player, offered_resources, recieving_player)[source]¶
Trade Class that controls behaviour of all trading actions that occur within the game
- Parameters:
offering_player (str, optional) – Name of player offering resources
offered_resources (str, optional) – Resources offered by offering_player
receiving_player (str, optional) – Name of player receiving offered_resources
is_accepted (bool) – boolean value designating whether or not the offer has been accepted
- accept_trade()[source]¶
Returns true as the trade has been accepted
- Returns:
True statement
- Return type:
bool
- cancel_trade()[source]¶
Cancels trade between two players
- Returns:
A message displaying or not the trade has been accepted or not
- Return type:
Union[str, bool]
- execute_trade()[source]¶
Executes the trade process so that the resources move from the offering_player to the receiving_player and ensures the offering_player no longer has the resources available.