/*
....[@@@..[@@@..............[@.................. 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@falcon.mercer.peachnet.edu 
MUD++ development mailing list    mudpp-list@spice.com
------------------------------------------------------------------------------
global.h
*/

// This file contains constants and externs that may not be specific
// to a certain class.


#define DEBUG


#ifndef _GLOBAL_H
#define _GLOBAL_H

#define SECOND				1000000
#define PULSE_PER_SEC		7
#define PULSE				SECOND / PULSE_PER_SEC


#define AREA_DIR        "../area"
#define AREA_FILE       "area.lst"
#define EMAIL_DIR       "../email"
#define MUDMAIL_DIR     "../mudmail"


// 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 PC;
class NPC;
class Environment;

extern int DOWN;
extern int REBOOT;
extern Help *help_list[MAX_HELP];
extern Environment envir;
extern Server server;

extern LList<Area>		areas;
extern LList<PC>		pcs;
extern LList<NPC>		npcs;
extern LList<Object>	objects;

// Global functions in alphabetical order
// Some of these may be either obsolete or missing

		int			bitNum( int );
		int			count_lines( const char * );
		void		error( char * );
		int			get_dir( char );
const	char	*	getObjBitName( int );
		int			getObjBit( const char * );
const	char	*	getObjTypeName( int );
		int			getObjType( const char * );
const	char	*	getWearBitName( int );
const	char	*	getWearPosName( int );
		int			getWearBit( const char * );
		PC		*	getPCWorld( const String & );
		NPC		*	getNPCWorld( const String & );
const	char	*	getDirName( int );
		int			getDir( char );
		int			getDir( const char * );
const	char	*	getDirName( int );
		void		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 * );
		char	*	str_cap( char * );
		char	*	str_chop( char * );
		char	*	str_clean( char * );
		int			str_cmp( const char *, const char * );
		char	*	str_lower( char * );


#endif