/****************************************************************************
* [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. *
* ------------------------------------------------------------------------ *
* Resets Interface file *
****************************************************************************/
#ifndef RESETS_H
#define RESETS_H
extern void ResetRoom (CRoomIndexData* pRoom, CAreaData* pArea);
#ifdef SMAUGSERVER_CPP
int gResetCount;
#endif
extern int gResetCount;
// Reset commands:
// '*': comment
// 'M': read a mobile
// 'O': read an object
// 'P': put object in object
// 'G': give object to mobile
// 'E': equip object to mobile
// 'H': hide an object
// 'B': set a bitvector
// 'T': trap an object
// 'D': set state of door
// 'R': randomize room exits
// 'S': stop (end of list)
// Area-reset definition.
class CResetData {
public:
CResetData () { memset (this, 0, sizeof (CResetData)); }
CResetData (char c, int ex, int m, int a1, int a2, int a3)
{ command=c; extra=ex; mob=m, arg1=a1; arg2=a2; arg3=a3;
++gResetCount; }
char command;
int extra;
int mob;
int arg1;
int arg2;
int arg3;
};
class CResetList : public CPtrList {
public:
~CResetList () { RemoveAll (); }
CResetData *GetNext (POSITION& pos)
{ m_CurPos = pos;
return (CResetData*) CPtrList::GetNext (pos); }
CResetData *GetPrev (POSITION& pos)
{ m_CurPos = pos;
return (CResetData*) CPtrList::GetPrev (pos); }
CResetData *GetAt (POSITION& pos)
{ return (CResetData*) CPtrList::GetAt (pos); }
BOOL FindPrevCommand (POSITION& pos, char c);
void Remove (CResetData* pReset)
{ POSITION p = Find (pReset); RemoveAt (p);
delete pReset; --gResetCount; }
void RemoveAll ()
{ while (!IsEmpty ()) delete (CResetData*) RemoveTail ();
CPtrList::RemoveAll (); }
POSITION GetCurPos () { return m_CurPos; }
private:
POSITION m_CurPos;
};
#endif