/*
....[@@@..[@@@..............[@.................. 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
------------------------------------------------------------------------------
help.h
*/
#ifndef _HELP_H
#define _HELP_H
#include "bit.h"
#include "nameable.h"
#include "streamable.h"
#include "pc.h"
#include "array.h"
#define HELP_DIR "../help"
#define HELP_FILE "help.lst"
#define STANDARD_HELP "../help/standard.hlp"
#define HINTS_FILE "../etc/hints.txt"
#define HINTS_HELP "../help/hints.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[];
extern Array<char *> hints;
extern bool hints_in_edit;
class HelpEditor;
class Help : public Nameable, public Streamable
{
private:
String filename;
int level;
bool locked;
unsigned long priv_needed;
unsigned long help_bits[MAX_HELP_BIT_FIELDS];
public:
Help() : Nameable(), level(0), locked(false)
{
priv_needed = 0;
memset( help_bits, 0, sizeof( help_bits[0] ) * MAX_HELP_BIT_FIELDS );
}
int readFrom( StaticInput & );
int writeTo( Output & ) 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;
};
int loadHints();
#endif