#ifndef NATIONS_H #define NATIONS_H class MudObject; #define Nation MudObject #define Currency MudObject World<Nation> nations(bool onlyplayable); const char *nation(const MudObject *o); Nation *natobj(const MudObject *o); Nation *natobj(const string &s); Nation *block(const MudObject *o); Nation *block(const string &s); bool hascurr(Nation *nat); int convertcash(int amount, Currency *from, Currency *to); Currency *currency(MudObject *who); string formatcash(int amount, Currency *of, bool _long); inline string formatvalue(int amount, Currency *of, bool _long) { return formatcash(convertcash(amount, 0, of), of, _long); } int cash(const MudObject *who, const Currency *nat); void set_cash(MudObject *who, const Currency *nat, int amount); int balance(const MudObject *who, const Currency *nat); void set_balance(MudObject *who, const Currency *nat, int amount); inline void bank_credit(MudObject *who, const Currency *cur, int amount) { set_balance(who, cur, balance(who, cur)+amount); } inline void cash_credit(MudObject *who, const Currency *cur, int amount) { set_cash(who, cur, cash(who, cur)+amount); } inline void bank_debit(MudObject *who, const Currency *cur, int amount) { set_balance(who, cur, balance(who, cur)-amount); } string prettynation(const string &s); int totalcash(const MudObject *who); bool anycash(const MudObject *who); void wipe_cash(MudObject *who); struct cashinfo { MudObject *cur; int amt; bool all; cashinfo() : cur(0), amt(0), all(0) { } cashinfo(MudObject *cur, int amt, bool all) : cur(cur), amt(amt), all(all) { } }; cashinfo curmatch(int argc, const char **argv, MudObject *defcur=0); void moveallcash(MudObject *from, MudObject *to); void describe_pot(MudObject *pot); void fine(MudObject *who, int what, const char *crime, MudObject *j=0); MudObject *jurisdiction(MudObject *where); string jname(MudObject *where); #endif