uox3/source/scriptc.h
Xoduz 37a76083de Rest of the changes for 0.99.6-RC1
Misc cleanup and standardization of style and naming conventions in code and scripts
Added missing code for showing race in paperdoll based on ini setting
Players can no longer use Polymorph spell while incognitoed, or while under effect of tribal paint
Players can no longer use Incognito spell while polymorphed, or while under the effects of tribal paint
Facial hair is now removed from players who are under the effects of Incognito spell that changes their gender for female
2022-10-24 18:39:33 +08:00

46 lines
1 KiB
C++

#ifndef __SCRIPTC_H__
#define __SCRIPTC_H__
#include <unordered_map>
typedef std::unordered_map<std::string, CScriptSection *> SSMAP;
class Script
{
public:
UI32 lastModTime;
Script( const std::string& _filename, DEFINITIONCATEGORIES d, bool disp = true );
~Script();
CScriptSection * FindEntry( const std::string& section );
CScriptSection * FindEntrySubStr( const std::string& section );
CScriptSection * FirstEntry();
CScriptSection * NextEntry();
auto collection() const -> const SSMAP &;
auto collection() -> SSMAP&;
bool IsInSection( const std::string& section );
std::string EntryName( void );
size_t NumEntries( void ) const
{
return defEntries.size();
}
bool IsErrored( void ) const
{
return errorState;
}
private:
void DeleteMap( void );
void Reload( bool disp = true );
bool CreateSection( std::string& name );
SSMAP defEntries; // string is the name of section
SSMAP::iterator iSearch;
time_t last_modification;
std::string filename;
bool errorState;
DEFINITIONCATEGORIES dfnCat;
std::ifstream input;
};
#endif