ChannelTextParser Class Reference

#include <ChannelTextParser.h>

Inheritance diagram for ChannelTextParser:

GLWChannelViewTextRenderer

List of all members.

Public Types

enum  ChannelTextEntryType {
  ePlayerEntry, eWeaponEntry, eChannelEntry,
  eAdminEntry, eTipEntry
}

Public Member Functions

 ChannelTextParser ()
virtual ~ChannelTextParser ()
void parseText (ScorchedContext &context, const LangString &text)
void subset (ChannelTextParser &other, int start, int len)
const LangStringgetString ()
ChannelTextEntrygetEntry (int position)

Protected Member Functions

bool parseUrl (ScorchedContext &context, const LangString &url, ChannelTextEntry &entry)
bool createPlayerEntry (ScorchedContext &context, const LangString &part, ChannelTextEntry &entry)
bool createWeaponEntry (ScorchedContext &context, const LangString &partt, ChannelTextEntry &entry)
bool createChannelEntry (ScorchedContext &context, const LangString &part, ChannelTextEntry &entry)
bool createTipEntry (ScorchedContext &context, const LangString &part, ChannelTextEntry &entry)
bool createAdminEntry (ScorchedContext &context, const LangString &part, ChannelTextEntry &entry)
void addIndex (int number, unsigned char index)

Protected Attributes

LangString text_
std::vector
< unsigned int > 
entryIndex_
std::vector
< ChannelTextEntry
entries_

Classes

struct  ChannelTextEntry


Detailed Description

Definition at line 29 of file ChannelTextParser.h.


Member Enumeration Documentation

enum ChannelTextParser::ChannelTextEntryType

Enumerator:
ePlayerEntry 
eWeaponEntry 
eChannelEntry 
eAdminEntry 
eTipEntry 

Definition at line 32 of file ChannelTextParser.h.


Constructor & Destructor Documentation

ChannelTextParser::ChannelTextParser (  ) 

Definition at line 26 of file ChannelTextParser.cpp.

ChannelTextParser::~ChannelTextParser (  )  [virtual]

Definition at line 30 of file ChannelTextParser.cpp.


Member Function Documentation

void ChannelTextParser::parseText ( ScorchedContext context,
const LangString text 
)

Definition at line 65 of file ChannelTextParser.cpp.

References addIndex(), entries_, entryIndex_, LANG_STRING, parseUrl(), LangStringUtil::strlen(), LangStringUtil::strstr(), ChannelTextParser::ChannelTextEntry::text, and text_.

Referenced by GLWChannelView::channelText(), and GLWChannelText::setChannelEntry().

void ChannelTextParser::subset ( ChannelTextParser other,
int  start,
int  len 
)

Definition at line 45 of file ChannelTextParser.cpp.

References entries_, entryIndex_, and text_.

Referenced by GLWChannelView::channelText().

const LangString& ChannelTextParser::getString (  )  [inline]

Definition at line 55 of file ChannelTextParser.h.

References text_.

Referenced by GLWChannelView::channelText(), GLWChannelView::draw(), and GLWChannelText::draw().

ChannelTextParser::ChannelTextEntry * ChannelTextParser::getEntry ( int  position  ) 

Definition at line 34 of file ChannelTextParser.cpp.

References entries_, and entryIndex_.

Referenced by GLWChannelViewTextRenderer::drawCharacter().

bool ChannelTextParser::parseUrl ( ScorchedContext context,
const LangString url,
ChannelTextEntry entry 
) [protected]

Definition at line 120 of file ChannelTextParser.cpp.

References createAdminEntry(), createChannelEntry(), createPlayerEntry(), createTipEntry(), createWeaponEntry(), LANG_STRING, ChannelTextParser::ChannelTextEntry::part, LangStringUtil::strlen(), and LangStringUtil::strstr().

Referenced by parseText().

bool ChannelTextParser::createPlayerEntry ( ScorchedContext context,
const LangString part,
ChannelTextEntry entry 
) [protected]

Definition at line 157 of file ChannelTextParser.cpp.

References ChannelTextParser::ChannelTextEntry::color, ChannelTextParser::ChannelTextEntry::data, ePlayerEntry, Tank::getColor(), Target::getPlayerId(), TankContainer::getTankByName(), ScorchedContext::getTankContainer(), ChannelTextParser::ChannelTextEntry::text, and ChannelTextParser::ChannelTextEntry::type.

Referenced by parseUrl().

bool ChannelTextParser::createWeaponEntry ( ScorchedContext context,
const LangString partt,
ChannelTextEntry entry 
) [protected]

Definition at line 176 of file ChannelTextParser.cpp.

References ChannelTextParser::ChannelTextEntry::color, eWeaponEntry, ChannelTextParser::ChannelTextEntry::text, and ChannelTextParser::ChannelTextEntry::type.

Referenced by parseUrl().

bool ChannelTextParser::createChannelEntry ( ScorchedContext context,
const LangString part,
ChannelTextEntry entry 
) [protected]

Definition at line 198 of file ChannelTextParser.cpp.

References eChannelEntry, ChannelTextParser::ChannelTextEntry::text, and ChannelTextParser::ChannelTextEntry::type.

Referenced by parseUrl().

bool ChannelTextParser::createTipEntry ( ScorchedContext context,
const LangString part,
ChannelTextEntry entry 
) [protected]

Definition at line 188 of file ChannelTextParser.cpp.

References ChannelTextParser::ChannelTextEntry::color, eTipEntry, ChannelTextParser::ChannelTextEntry::text, and ChannelTextParser::ChannelTextEntry::type.

Referenced by parseUrl().

bool ChannelTextParser::createAdminEntry ( ScorchedContext context,
const LangString part,
ChannelTextEntry entry 
) [protected]

Definition at line 209 of file ChannelTextParser.cpp.

References ChannelTextParser::ChannelTextEntry::color, eAdminEntry, LANG_RESOURCE, ChannelTextParser::ChannelTextEntry::text, and ChannelTextParser::ChannelTextEntry::type.

Referenced by parseUrl().

void ChannelTextParser::addIndex ( int  number,
unsigned char  index 
) [protected]

Definition at line 57 of file ChannelTextParser.cpp.

References entryIndex_.

Referenced by parseText().


Member Data Documentation

LangString ChannelTextParser::text_ [protected]

Definition at line 60 of file ChannelTextParser.h.

Referenced by getString(), parseText(), and subset().

std::vector<unsigned int> ChannelTextParser::entryIndex_ [protected]

Definition at line 61 of file ChannelTextParser.h.

Referenced by addIndex(), getEntry(), parseText(), and subset().

std::vector<ChannelTextEntry> ChannelTextParser::entries_ [protected]

Definition at line 62 of file ChannelTextParser.h.

Referenced by getEntry(), parseText(), and subset().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:00 2009 for Scorched3D by  doxygen 1.5.3