Planeshift
SpellManager Class Reference

Manager class that handles loading/searching/casting spells. More...

#include <spellmanager.h>

Public Member Functions

void Cast (gemActor *caster, const csString &spellName, float kFactor, Client *client)
 Case a particular spell. More...
 
void EndPurifying (psCharacter *character, uint32 glyphUID)
 Purifying on a glyph has been complete. More...
 
void HandleGlyphRequest (MsgEntry *notused, Client *client)
 Handles a glyph request from a client. More...
 
void SendGlyphs (MsgEntry *notused, Client *client)
 Sends out the glyphs to a client. More...
 
 SpellManager (ClientConnectionSet *clients, iObjectRegistry *object_reg, CacheManager *cachemanager)
 
virtual ~SpellManager ()
 
- Public Member Functions inherited from MessageManager< SpellManager >
void HandleMessage (MsgEntry *msg, Client *client)
 Transfers the message to the manager specific function. More...
 
void Subscribe (FunctionPointer fpt, msgtype type, uint32_t flags=0x01)
 Subscribes this manager to a specific message type with a custom callback. More...
 
bool Unsubscribe (msgtype type)
 Unsubscribes this manager from a specific message type. More...
 
bool Unsubscribe (FunctionPointer handler, msgtype type)
 Unsubscribes a specific handler from a specific message type. More...
 
bool UnsubscribeAll ()
 Unsubscribes this manager from all message types. More...
 
virtual ~MessageManager ()
 Unsubscribes all messages then destroys this object. More...
 
- Public Member Functions inherited from MessageManagerBase
csArray< csString > DecodeCommandArea (Client *client, csString target)
 Decodes an area: expression. More...
 
gemObject * FindObjectByString (const csString &str, gemActor *me) const
 Find the object we are referring to in str. More...
 
Client * FindPlayerClient (const char *name)
 Finds Client* of character with given name. More...
 
virtual bool Verify (MsgEntry *pMsg, unsigned int flags, Client *&client)
 

Protected Member Functions

void Cast (MsgEntry *me, Client *client)
 Case a particular spell. More...
 
psSpell * FindSpell (Client *client, const glyphList_t &assembler)
 Find a spell in the assorted glyphs. More...
 
void HandleAssembler (MsgEntry *me, Client *client)
 Handles a command when player tries to research. More...
 
void HandleCancelSpell (MsgEntry *notused, Client *client)
 
void SaveSpell (Client *client, csString spellName)
 Save a spell to the database for when a player has researched it. More...
 
void SendSpellBook (MsgEntry *notused, Client *client)
 Send the player's spell book. More...
 
void StartPurifying (MsgEntry *me, Client *client)
 Start to purify a glyph. More...
 

Protected Attributes

CacheManager * cacheManager
 
ClientConnectionSet * clients
 
iObjectRegistry * object_reg
 

Additional Inherited Members

- Public Types inherited from MessageManager< SpellManager >
typedef void(SpellManager::* FunctionPointer) (MsgEntry *, Client *)
 

Detailed Description

Manager class that handles loading/searching/casting spells.

This class also manages a number of psSpell Events.

Definition at line 51 of file spellmanager.h.

Constructor & Destructor Documentation

SpellManager::SpellManager ( ClientConnectionSet *  clients,
iObjectRegistry *  object_reg,
CacheManager *  cachemanager 
)
virtual SpellManager::~SpellManager ( )
virtual

Member Function Documentation

void SpellManager::Cast ( MsgEntry *  me,
Client *  client 
)
protected

Case a particular spell.

Parameters
memessage entry for the client spell caster message.
clientthe clien that cast the spell.
void SpellManager::Cast ( gemActor *  caster,
const csString &  spellName,
float  kFactor,
Client *  client 
)

Case a particular spell.

Parameters
casterThe caster of the spell.
spellNameThe name of the spell to cast.
kFactorThe power factor that the spell is cast with.
clientThe client that is casting the spell.
void SpellManager::EndPurifying ( psCharacter *  character,
uint32  glyphUID 
)

Purifying on a glyph has been complete.

This will send out a network message to the client and update it's inventory with the new purified glyph.

Parameters
characterThe character this is for.
glyphUIDThe unique ID for this item instance of the glyph.
psSpell* SpellManager::FindSpell ( Client *  client,
const glyphList_t &  assembler 
)
protected

Find a spell in the assorted glyphs.

This checks ths list of glyphs and see if it matches any known spell. This is for when players are researching spells.

Parameters
clientThe client this data is for.
assemblerA list of glyphs to check for spell match.
Returns
A spell if a match found, NULL otherwise.
void SpellManager::HandleAssembler ( MsgEntry *  me,
Client *  client 
)
protected

Handles a command when player tries to research.

Parameters
clientThe client this is for.
meThe message from that client.
void SpellManager::HandleCancelSpell ( MsgEntry *  notused,
Client *  client 
)
protected
void SpellManager::HandleGlyphRequest ( MsgEntry *  notused,
Client *  client 
)

Handles a glyph request from a client.

Parameters
notusedA not used message entry.
clientThe client that requested glyphs.
void SpellManager::SaveSpell ( Client *  client,
csString  spellName 
)
protected

Save a spell to the database for when a player has researched it.

Parameters
clientThe client that this is for.
spellNameThe name of the spell to save for that player.
void SpellManager::SendGlyphs ( MsgEntry *  notused,
Client *  client 
)

Sends out the glyphs to a client.

Builds and sends psRequestGlyphsMessage for the client.

Parameters
notusedA not used message entry.
clientThe client that will be sent it's current glyphs.
void SpellManager::SendSpellBook ( MsgEntry *  notused,
Client *  client 
)
protected

Send the player's spell book.

Parameters
notusedA not used message entry.
clientThe client that will be sent the spell book.
void SpellManager::StartPurifying ( MsgEntry *  me,
Client *  client 
)
protected

Start to purify a glyph.

This will also send out notifications to the client about the start of operation.

Parameters
meThe inncomming message.
clientThe client that this data is for.

Member Data Documentation

CacheManager* SpellManager::cacheManager
protected

Definition at line 162 of file spellmanager.h.

ClientConnectionSet* SpellManager::clients
protected

Definition at line 160 of file spellmanager.h.

iObjectRegistry* SpellManager::object_reg
protected

Definition at line 161 of file spellmanager.h.


The documentation for this class was generated from the following file: