/* ....[@@@..[@@@..............[@.................. MUD++ is a written from ....[@..[@..[@..[@..[@..[@@@@@....[@......[@.... scratch multi-user swords and ....[@..[@..[@..[@..[@..[@..[@..[@@@@@..[@@@@@.. sorcery game written in C++. ....[@......[@..[@..[@..[@..[@....[@......[@.... This server is an ongoing ....[@......[@..[@@@@@..[@@@@@.................. development project. All ................................................ contributions are welcome. ....Copyright(C).1995.Melvin.Smith.............. Enjoy. ------------------------------------------------------------------------------ Melvin Smith (aka Fusion) msmith@hom.net MUD++ development mailing list mudpp@van.ml.org ------------------------------------------------------------------------------ global.h */ // This file contains constants and externs that may not be specific // to a certain class. #ifndef _GLOBAL_H #define _GLOBAL_H #include "llist.h" #include "hash.h" #define SECOND 1000000 #define PULSE_PER_SEC 7 #define PULSE SECOND / PULSE_PER_SEC #define ACTION_PULSE 4 #define AREA_DIR "../area" #define AREA_FILE "area.lst" #define EMAIL_DIR "../email" #define MUDMAIL_DIR "../mudmail" #define SECURE_EDITOR "../bin/spico" #define TMP_DIR "../tmp" // Change this to a LList #define MAX_HELP 1024 // Here to satisfy compiler without including the header file class String; class Server; class Help; class Area; class Object; class Room; class PC; class NPC; class Char; class Environment; class Action; class Index; class ShopKeeper; #ifndef _CONFIG_H typedef unsigned char bool; const unsigned char true = 1; const unsigned char false = 0; #endif /* _CONFIG_H */ extern bool DOWN; extern bool REBOOT; extern bool NOFATALERROR; extern Environment envir; extern Server server; extern LList<Area> areas; extern LList<PC> pcs; extern LList<PC> shellpcs; extern LList<NPC> npcs; extern LList<ShopKeeper> shops; extern LList<Object> objects; extern LList<Action> actions; extern LList<Help> helps_ll; extern HashTable<Help> helps_ht; #if !defined(WIN32) inline int max( int x, int y ) { return ( x > y ? x : y ); } inline int min( int x, int y ) { return ( x < y ? x : y ); } #endif // Global functions in alphabetical order // Some of these may be either obsolete or missing int count_lines( const char * ); int get_dir( char ); Room * getFirstRoom(); const char * getObjBitName( int ); int getObjBit( const char * ); const char * lookupObjTypeName( int ); int lookupObjType( const char * ); const char * getWearBitName( int ); const char * getWearPosName( int ); int getWearBit( const char * ); PC * getPCOther( const String &, PC * ); PC * getPCWorld( const String & ); NPC * getNPCWorld( const String & ); Object * getObjWorld( const String & ); const char * lookupDirName( int ); int getDir( char ); int getDir( const char * ); int getRevDir( int ); const char * lookupDirName( int ); void heartbeat( void ); void action_heartbeat( void ); bool is_num( const char * ); const char * itoa( int ); void loadHelps(); Area * lookupArea( const char * ); Area * lookupArea( const String & ); Room * lookupRoom( const Index & ); Room * lookupRoom( const String & ); Room * lookupRoom( const char * ); NPC * lookupNPC( const Index & ); NPC * lookupNPC( const String & ); NPC * lookupNPC( const char * ); Object * lookupObj( const Index & ); Object * lookupObj( const String & ); Object * lookupObj( const char * ); const char * ltoa( unsigned long ); Object * makeCorpse( Char * ); void outAllChar( const String & str ); void outAllCharExcept( const String &, Char *, Char * ); void wizLog( const String &, const PC * ); // Yuck // I would make this function but there is an error // LList<Nameable> is not base class for LList<Object> #define parseCompositeName( to,where, what ) \ for_each( where , to )\ {\ if ( to->isName( what.name ) )\ {\ what.count--;\ if ( !what.count )\ break;\ }\ } #endif // _GLOBAL_H