Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

SpellManager Class Reference

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

#include <spellmanager.h>

List of all members.

Public Member Functions

void Cast (gemActor *caster, const csString &spellName, float kFactor, Client *client)
 Case a particular spell.
void EndPurifying (psCharacter *character, uint32 glyphUID)
 Purifying on a glyph has been complete.
void HandleGlyphRequest (MsgEntry *notused, Client *client)
 Handles a glyph request from a client.
void SendGlyphs (MsgEntry *notused, Client *client)
 Sends out the glyphs to a client.
 SpellManager (ClientConnectionSet *clients, iObjectRegistry *object_reg, CacheManager *cachemanager)
virtual ~SpellManager ()

Protected Member Functions

void Cast (MsgEntry *me, Client *client)
 Case a particular spell.
psSpellFindSpell (Client *client, const glyphList_t &assembler)
 Find a spell in the assorted glyphs.
void HandleAssembler (MsgEntry *me, Client *client)
 Handles a command when player tries to research.
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.
void SendSpellBook (MsgEntry *notused, Client *client)
 Send the player's spell book.
void StartPurifying (MsgEntry *me, Client *client)
 Start to purify a glyph.

Protected Attributes

CacheManagercacheManager
ClientConnectionSetclients
iObjectRegistry * object_reg

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

Definition at line 162 of file spellmanager.h.

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: