Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
73 lines (63 sloc) 1.31 KB
#ifndef __JAIL_H__
#define __JAIL_H__
namespace UOX
{
struct JailOccupant
{
SERIAL pSerial;
SI16 x;
SI16 y;
SI08 z;
UI08 world;
time_t releaseTime;
JailOccupant() : pSerial( INVALIDSERIAL ), x( 0 ), y( 0 ), z( 0 ), world( 0 ), releaseTime( 0 )
{
}
};
class JailCell
{
private:
SI16 x;
SI16 y;
SI08 z;
UI08 world;
std::vector< JailOccupant * > playersInJail;
public:
JailCell() : x( 0 ), y( 0 ), z( 0 ), world( 0 )
{
}
~JailCell();
bool IsEmpty( void ) const;
size_t JailedPlayers( void ) const;
SI16 X( void ) const;
SI16 Y( void ) const;
SI08 Z( void ) const;
UI08 World( void ) const;
void X( SI16 nVal );
void Y( SI16 nVal );
void Z( SI08 nVal );
void World( UI08 nVal );
void AddOccupant( CChar *pAdd, SI32 secsFromNow ) ;
void EraseOccupant( size_t occupantID );
JailOccupant *Occupant( size_t occupantID );
void PeriodicCheck( void );
void AddOccupant( JailOccupant *toAdd );
void WriteData( std::ofstream &outStream, size_t cellNum );
};
class JailSystem
{
private:
std::vector< JailCell > jails;
public:
JailSystem();
~JailSystem();
void ReadSetup( void );
void ReadData( void );
void WriteData( void );
void PeriodicCheck( void );
bool JailPlayer( CChar *toJail, SI32 numSecsToJail );
void ReleasePlayer( CChar *toRelase );
};
extern JailSystem *JailSys;
}
#endif