Planeshift
spellmanager.h
Go to the documentation of this file.
1 /*
2  * spellmanager.h by Anders Reggestad <andersr@pvv.org>
3  *
4  * Copyright (C) 2001-2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef __SPELLMANAGER_H__
21 #define __SPELLMANAGER_H__
22 
23 //=============================================================================
24 // Crystal Space Includes
25 //=============================================================================
26 #include <csutil/randomgen.h>
27 #include <csutil/sysfunc.h>
28 
29 //=============================================================================
30 // Library Includes
31 //=============================================================================
32 #include "util/gameevent.h"
33 
34 //=============================================================================
35 // Server includes
36 //=============================================================================
37 #include "msgmanager.h" // Subscriber class
38 
39 //=============================================================================
40 // Forward Declarations
41 //=============================================================================
42 
44 class psSpell;
45 
51 class SpellManager : public MessageManager<SpellManager>
52 {
53 public:
54 
56  iObjectRegistry* object_reg,
57  CacheManager* cachemanager);
58  virtual ~SpellManager();
59 
69  void EndPurifying(psCharacter* character, uint32 glyphUID);
70 
79  void SendGlyphs(MsgEntry* notused, Client* client);
80 
87  void HandleGlyphRequest(MsgEntry* notused, Client* client);
88 
89 protected:
96  void SaveSpell(Client* client, csString spellName);
97 
104  void Cast(MsgEntry* me, Client* client);
105 
106 public:
115  void Cast(gemActor* caster, const csString &spellName, float kFactor, Client* client);
116 
117 protected:
118 
119  void HandleCancelSpell(MsgEntry* notused, Client* client);
120 
127  void SendSpellBook(MsgEntry* notused, Client* client);
128 
137  void StartPurifying(MsgEntry* me, Client* client);
138 
150  psSpell* FindSpell(Client* client, const glyphList_t &assembler);
151 
158  void HandleAssembler(MsgEntry* me,Client* client);
159 
161  iObjectRegistry* object_reg;
163 };
164 
165 #endif
void SaveSpell(Client *client, csString spellName)
Save a spell to the database for when a player has researched it.
void HandleAssembler(MsgEntry *me, Client *client)
Handles a command when player tries to research.
void SendSpellBook(MsgEntry *notused, Client *client)
Send the player&#39;s spell book.
iObjectRegistry * object_reg
Definition: spellmanager.h:161
Manager class that handles loading/searching/casting spells.
Definition: spellmanager.h:51
CacheManager * cacheManager
Definition: spellmanager.h:162
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
void EndPurifying(psCharacter *character, uint32 glyphUID)
Purifying on a glyph has been complete.
csArray< psItemStats * > glyphList_t
Definition: psspell.h:66
ClientConnectionSet * clients
Definition: spellmanager.h:160
psSpell * FindSpell(Client *client, const glyphList_t &assembler)
Find a spell in the assorted glyphs.
Any semi-autonomous object, either a player or an NPC.
Definition: gem.h:1170
Represents a spell.
Definition: psspell.h:74
virtual ~SpellManager()
This class collects data of a netclient.
Definition: client.h:95
void Cast(MsgEntry *me, Client *client)
Case a particular spell.
void HandleCancelSpell(MsgEntry *notused, Client *client)
SpellManager(ClientConnectionSet *clients, iObjectRegistry *object_reg, CacheManager *cachemanager)
This class manages the caching of data that is unchanging during server operation.
Definition: cachemanager.h:234
void StartPurifying(MsgEntry *me, Client *client)
Start to purify a glyph.
This class is a list of several CLient objects, it&#39;s designed for finding clients very fast based on ...
Definition: clients.h:58
void SendGlyphs(MsgEntry *notused, Client *client)
Sends out the glyphs to a client.
void HandleGlyphRequest(MsgEntry *notused, Client *client)
Handles a glyph request from a client.
Provides a manager to facilitate subscriptions.
Definition: msgmanager.h:106