/* ....[@@@..[@@@..............[@.................. 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-list@mailhost.net ------------------------------------------------------------------------------ help.h */ #ifndef _HELP_H #define _HELP_H #include "bit.h" #include "nameable.h" #include "streamable.h" #include "pc.h" #define HELP_DIR "../help" #define HELP_FILE "help.lst" #define STANDARD_HELP "../help/standard.hlp" // help special bits const int ALL_CAN_READ = 1; const int NO_TITLE = 2; const int MAX_HELP_BIT_FIELDS = 1; extern const bitType help_bit_list[]; class HelpEditor; class Help : public Nameable, public Streamable { private: String filename; int level; bool locked; unsigned long priv_needed[MAX_PRIV_BIT_FIELDS]; unsigned long help_bits[MAX_HELP_BIT_FIELDS]; public: Help() : Nameable(), level(0), locked(false) { memset( priv_needed, 0, sizeof( priv_needed[0] ) * MAX_PRIV_BIT_FIELDS ); memset( help_bits, 0, sizeof( help_bits[0] ) * MAX_HELP_BIT_FIELDS ); } int readFrom( InFile & ); int writeTo( OutFile & ) const; bool isAllowed( PC * pc ); // can Pc read this help ? void lock() { locked = true; } void unlock() { locked = false; } bool isLocked() { return locked; } void setFileName( const String & x ) { filename = x; } const String & getFileName() { return filename; } void setLevel( int x ) { level = x; } int getLevel() { return level; } bool haveTitle() { return !IS_SET(help_bits,NO_TITLE); } static void add( Help * ); static void remove( Help *); friend class HelpEditor; }; #endif