Planeshift
progressionmanager.h
Go to the documentation of this file.
1 /*
2  * progressionmanager.h
3  *
4  * Copyright (C) 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 #ifndef __PROGRESSIONMANAGER_H__
20 #define __PROGRESSIONMANAGER_H__
21 
22 //=============================================================================
23 // Crystal Space Includes
24 //=============================================================================
25 #include <csutil/array.h>
26 #include <csutil/hash.h>
27 #include <iutil/document.h>
28 
29 //=============================================================================
30 // Library Includes
31 //=============================================================================
32 #include "util/gameevent.h"
33 
34 #include "bulkobjects/psskills.h"
35 
36 //=============================================================================
37 // Application Includes
38 //=============================================================================
39 #include "msgmanager.h" // Subscriber class
40 
41 class psCharacter;
42 class ProgressionScript;
43 
48 class ProgressionManager : public MessageManager<ProgressionManager>
49 {
50 public:
51 
53 
54  virtual ~ProgressionManager();
55 
64  void SendSkillList(Client* client, bool forceOpen, PSSKILL focus = PSSKILL_NONE, bool isTraining = false);
65 
66  void StartTraining(Client* client, psCharacter* trainer);
67 
68  csHash<csString, csString> &GetAffinityCategories()
69  {
70  return affinitycategories;
71  }
72 
73  // Internal utility functions for the progression system
74  void QueueEvent(psGameEvent* event);
75  void SendMessage(MsgEntry* me);
76  void Broadcast(MsgEntry* me);
77 
78  ProgressionScript* FindScript(char const* name);
79 
83  bool Initialize(iObjectRegistry* object_reg);
84 
88 
89 protected:
90 
91  void HandleSkill(MsgEntry* me, Client* client);
92  void HandleDeathEvent(MsgEntry* me, Client* notused);
93  void HandleZPointEvent(MsgEntry* me, Client* client);
94 
95  void AllocateKillDamage(gemActor* deadActor, int exp);
96 
97  csHash<csString, csString> affinitycategories;
101 };
102 
105 #endif
106 
void QueueEvent(psGameEvent *event)
ProgressionScript is the imperative script container.
Definition: scripting.h:78
A MathScript is a mini-program to run.
Definition: mathscript.h:442
The structure of 1 queue entry (pointer to a message)
Definition: message.h:143
void SendMessage(MsgEntry *me)
MathScript * calc_dynamic_experience
Math script used to calculate the dynamic experience.
Any semi-autonomous object, either a player or an NPC.
Definition: gem.h:1170
void AllocateKillDamage(gemActor *deadActor, int exp)
PSSKILL
Definition: psskills.h:44
csHash< csString, csString > affinitycategories
void HandleDeathEvent(MsgEntry *me, Client *notused)
ClientConnectionSet * clients
This class collects data of a netclient.
Definition: client.h:95
bool Initialize(iObjectRegistry *object_reg)
Load progression script from db.
virtual ~ProgressionManager()
void SendSkillList(Client *client, bool forceOpen, PSSKILL focus=PSSKILL_NONE, bool isTraining=false)
Send the skill list to the client.
void HandleSkill(MsgEntry *me, Client *client)
csHash< csString, csString > & GetAffinityCategories()
void StartTraining(Client *client, psCharacter *trainer)
void HandleZPointEvent(MsgEntry *me, Client *client)
This class manages the caching of data that is unchanging during server operation.
Definition: cachemanager.h:234
ProgressionScript * FindScript(char const *name)
void Broadcast(MsgEntry *me)
This class is a list of several CLient objects, it&#39;s designed for finding clients very fast based on ...
Definition: clients.h:58
CacheManager * cacheManager
All scheduled events must inherit from this class.
Definition: gameevent.h:36
ProgressionManager(ClientConnectionSet *ccs, CacheManager *cachemanager)
Provides a manager to facilitate subscriptions.
Definition: msgmanager.h:106