currency.currency
index
/home/thindil/Projekty/anaria/server/lib/pymodules/currency/currency.py

currency.py
 
Supports denominations for multiple currency types. Currency does not
necessarily have to be money; it can be any 'spendable' thing, such as
questpoints, kill tokens, experience, faction favor, etc.
 
Currency is supported by a matching item type; when items of the currency type
are picked up or received, they are immediately turned into the relevant
currency, and extracted.

 
Modules
       
auxiliary
hooks
mud
obj
mudsys
storage
utils

 
Classes
       
CurrencyAuxData
Denomination
Worth

 
class CurrencyAuxData
    Holds Worth information for one character.
 
  Methods defined here:
__init__(s, set=None)
copy(s)
copyTo(s, to)
store(s)

 
class Denomination
    Contains information about one type of denomination for a type of
currency.
 
  Methods defined here:
__init__(s, name, currency, value=1, shorthand=None)

 
class Worth
    Contains information about a collection of currency denominations. Worths
are immutable, but they can be added, subtracted, and compared. gt and lt
comparisons are not strictly ordered. The property of reflexiveness is
is lost when worths containing different currencies (e.g., money and
questpoints) are compared.
 
  Methods defined here:
__add__(s, y)
__eq__(s, y)
__ge__(s, y)
__getitem__(s, denom)
Takes a denomination or a currency name. For a denomination, returns
the count of that denomination within the worth. If a currency name
is supplied, returns the sum of all denominations for it, in terms
of the base denomination.
__gt__(s, y)
__init__(s, set=None)
__le__(s, y)
__len__(s)
Returns the number of denominations in the worth.
__lt__(s, y)
__str__(s)
__sub__(s, y)
copy(s)
simplify(s)
Returns a copy of the worth, with all of its denominations reduced
down to their simplest type. e.g., 1 gold becomes 10 silver, etc...
store(s)

 
Functions
       
__getWorth__(s)
__setWorth__(s, worth)
################################################################################
# properties
################################################################################
get_currency_hook(info)
Turns a currency object into actual currency when taken.
get_denomination(s, denom)
give_currency_hook(info)
Turns a currency object into actual currency when received.
register_denomination(name, currency, value=1, shorthand=None)
Create a new denomination for a specified type of currency. For example,
'gold' for 'money'. If the currency is not yet created, create it. Each
denomination has a value. For example, copper may be 1, silver may
be 10, gold may be 100, and platinum may be 1000.
set_denomination(s, denom, val)

 
Data
        currency_base = {'money': <currency.currency.Denomination instance>}
currency_denominations = {'money': [<currency.currency.Denomination instance>, <currency.currency.Denomination instance>, <currency.currency.Denomination instance>]}
denominations = {'miedziaki': <currency.currency.Denomination instance>, 'srebrniki': <currency.currency.Denomination instance>, 'z\xc5\x82ocisze': <currency.currency.Denomination instance>}