/* ....[@@@..[@@@..............[@.................. 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@falcon.mercer.peachnet.edu MUD++ development mailing list mudpp-list@spice.com ------------------------------------------------------------------------------ area.h */ #ifndef _AREA_H #define _AREA_H #include "string.h" #include "file.h" #include "bit.h" #include "affect.h" #include "vector.h" #include "combat.h" #include "indexable.h" #include "room.h" #include "object.h" #include "npc.h" // Area is not really a thing but the methods for Thing are applicable class Area : public Nameable, public Streamable { protected: String file; String key; short int security; int a_flags; int repop_time; int timer; String repop_messg; String builder; short int mods; char dirty_bit; public: IndexList<Room> roomIndex; IndexList<Object> objIndex; IndexList<NPC> npcIndex; Area() : security(1),a_flags(0),repop_time(2), timer(0), repop_messg("Bonk!"),mods(0),dirty_bit(0) { } Area( const String & x ) : key(x), repop_time(2), timer(0), mods(0), dirty_bit(0) { file << x << ".are"; } void setDirtyBit() { dirty_bit = 1; } void rmDirtyBit() { dirty_bit = 0; } int getDirtyBit() { return dirty_bit; } virtual void addAffect( Affect * ) {} // area affects (conceivable) virtual void rmAffect( int ) {} // Send text to all players in an area. virtual void outAllChar( const char * ); virtual void outAllChar( const String & x ) { outAllChar( x.chars() ); } virtual void outAllCharExcept( const char *, PC * ); virtual void outAllCharExcept( const String & x, PC * pc ) { outAllCharExcept( x, pc ); } void setKey( const String & x ) { key = x; } const String & getKey() { return key; } int reload(); int readProtoFrom( InFile & ) { return -1; } int readFrom() { return Streamable::readFrom( file ); } int readFrom( InFile & ); int writeProtoTo( OutFile & ) const { return -1; } int writeTo() const { return Streamable::writeTo( file ); } int writeTo( OutFile & ) const; void hardLink(); const String & getFile(); void setFile( const String & ); const String & getBuilder(); void Builder( const String & ); int getSecurity() const; int getRepopTime(); void setRepopTime( int t ); const String & getRepopMessg(); void setRepopMessg( const String & ); Object *lookupObj( const Index & ); Object *lookupObj( const String & ); Object *lookupObj( const char * ); Object *createObj( const Index & ); NPC *lookupNPC( const Index & ); NPC *lookupNPC( const String & ); NPC *lookupNPC( const char * ); NPC *createNPC( const Index & ); Room * lookupRoom( const Index & ); Room * lookupRoom( const String & ); Room * lookupRoom( const char * ); void repop(); void tick() { if( ++timer >= repop_time ) repop(); } int addRoom( Room *room ); Room *getRoom( const Index & ); }; #endif