/****************************************************************************
* [S]imulated [M]edieval [A]dventure multi[U]ser [G]ame | *
* -----------------------------------------------------------| \\._.// *
* SmaugWiz (C) 1998 by Russ Pillsbury (Windows NT version) | (0...0) *
* -----------------------------------------------------------| ).:.( *
* SMAUG (C) 1994, 1995, 1996 by Derek Snider | {o o} *
* -----------------------------------------------------------| / ' ' \ *
* SMAUG code team: Thoric, Altrag, Blodkai, Narn, Haus, |~'~.VxvxV.~'~*
* Scryn, Swordbearer, Rennard, Tricops, and Gorog. | *
* ------------------------------------------------------------------------ *
* Merc 2.1 Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik Staerfeldt, Tom Madsen, and Katja Nyboe. *
* ------------------------------------------------------------------------ *
* Socials Interface file *
****************************************************************************/
#ifndef SOCIAL_H
#define SOCIAL_H
// Structure for a social in the socials table.
class CSocialType {
public:
CSocialType () { memset (this, 0, sizeof (CSocialType)); }
~CSocialType ();
CSocialType *GetNext () { return m_pNext; }
void SetNext (CSocialType* n) { m_pNext = n; }
BOOL Read (FILE* fp);
void Write (FILE* fp);
char *GetName () { return m_pName; }
void SetName (char* n) { m_pName = n; }
friend class CSocialTable;
private:
CSocialType *m_pNext;
char *m_pName;
public:
char *char_no_arg;
char *others_no_arg;
char *char_found;
char *others_found;
char *vict_found;
char *char_auto;
char *others_auto;
};
class CSocialTable {
public:
CSocialTable () { Empty (); }
~CSocialTable ();
void Empty () { memset (this, 0, sizeof (CSocialTable)); }
void Load ();
void Add (CSocialType* pNew);
void Unlink (CSocialType *social);
CSocialType *GetSocial (int hash)
{ ASSERT (hash >= 0 && hash < MAX_SOCIALS);
return m_sa [hash]; }
void RemoveAll ();
void Write ();
CSocialType *Find (char* name);
int GetHash (char k)
{ if (k < 'a' || k > 'z') return 0;
else return k - 'a' + 1; }
private:
CSocialType *m_sa [MAX_SOCIALS];
};
#ifdef SMAUGSERVER_CPP
CSocialTable SocialTable;
#endif
extern CSocialTable SocialTable;
#endif // SOCIAL_H