Planeshift

spellmanager.h

Go to the documentation of this file.
00001 /*
00002  * spellmanager.h by Anders Reggestad <[email protected]>
00003  *
00004  * Copyright (C) 2001-2003 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 
00020 #ifndef __SPELLMANAGER_H__
00021 #define __SPELLMANAGER_H__
00022 
00023 //=============================================================================
00024 // Crystal Space Includes
00025 //=============================================================================
00026 #include <csutil/randomgen.h>
00027 #include <csutil/sysfunc.h>
00028 
00029 //=============================================================================
00030 // Library Includes
00031 //=============================================================================
00032 #include "util/gameevent.h"
00033 
00034 //=============================================================================
00035 // Server includes
00036 //=============================================================================
00037 #include "msgmanager.h"   // Subscriber class
00038 
00039 //=============================================================================
00040 // Forward Declarations
00041 //=============================================================================
00042 
00043 class ClientConnectionSet;
00044 class psSpell;
00045 
00051 class SpellManager : public MessageManager<SpellManager>
00052 {
00053 public:
00054 
00055     SpellManager(ClientConnectionSet* clients,
00056                  iObjectRegistry* object_reg,
00057                  CacheManager* cachemanager);
00058     virtual ~SpellManager();
00059 
00069     void EndPurifying(psCharacter* character, uint32 glyphUID);
00070 
00079     void SendGlyphs(MsgEntry* notused, Client* client);
00080 
00087     void HandleGlyphRequest(MsgEntry* notused, Client* client);
00088 
00089 protected:
00096     void SaveSpell(Client* client, csString spellName);
00097 
00104     void Cast(MsgEntry* me, Client* client);
00105 
00106 public:
00115     void Cast(gemActor* caster, const csString &spellName, float kFactor, Client* client);
00116 
00117 protected:
00118 
00119     void HandleCancelSpell(MsgEntry* notused, Client* client);
00120 
00127     void SendSpellBook(MsgEntry* notused, Client* client);
00128 
00137     void StartPurifying(MsgEntry* me, Client* client);
00138 
00150     psSpell* FindSpell(Client* client, const glyphList_t &assembler);
00151 
00158     void HandleAssembler(MsgEntry* me,Client* client);
00159 
00160     ClientConnectionSet* clients;
00161     iObjectRegistry* object_reg;
00162     CacheManager* cacheManager;
00163 };
00164 
00165 #endif