Table of Contents
empyreal.engine.economy
  Controller class
  Main interface

empyreal.engine.economy

Controller class

class empyreal.engine.economy.EconomyController(user_id=None, session=None, server=None)

The controller class for the Economy interface used by the clients. This controller is a subclass of empyreal.engine.core.GameController.

Main interface

EconomyController.get_market_place_items(location_id=None)

Returns a list with dictionaries containing the item name, the number of the item available for sale and the minimum price for the Market Place in the provided location. If location_id is omitted the users Prophet current location will be used instead.

Raises an EmpyrealException if there is no Market Place at the used location.

EconomyController.purchase_item(item_type, cnt=1, location_id=None)

Adds the cnt number of resources of item_type in the location to the users religion.

Raises an InsufficientItemsForSaleException in case there are not enough items of the provided type for sale.

Raises an UserIsOutOfActionPointsException if the user has no actions points.

Raises a ReligionInsufficientCurrencyException if the user has insufficient currency.

Raises an UserIsBusyException if the user is currently busy.

Returns a empyreal.lib.models.CardResult.

EconomyController.sell_item(item_type, cnt=1, location_id=None)

Removes cnt number of resources of item_type from the users religion at their current location in return for Gold.

Raises an InsufficientItemsForSaleException in case the user does not have enough items of item_type available in the current location.

Raises an UserIsBusyException if the user is currently busy.

Returns a empyreal.lib.models.CardResult.