Planeshift
serversongmngr.h
Go to the documentation of this file.
1
/*
2
* serversongmngr.h, Author: Andrea Rizzi <88whacko@gmail.com>
3
*
4
* Copyright (C) 2001-2011 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 SERVER_SONG_MANAGER_H
21
#define SERVER_SONG_MANAGER_H
22
23
24
//====================================================================================
25
// Project Includes
26
//====================================================================================
27
#include <
util/gameevent.h
>
28
29
//====================================================================================
30
// Local Includes
31
//====================================================================================
32
#include "
msgmanager.h
"
33
34
//------------------------------------------------------------------------------------
35
// Forward Declarations
36
//------------------------------------------------------------------------------------
37
class
psItem
;
38
class
MathScript
;
39
class
psCharacter
;
40
struct
ScoreStatistics
;
41
42
46
class
psEndSongEvent
:
public
psGameEvent
47
{
48
public
:
54
psEndSongEvent
(
gemActor
* charActor,
int
songLength);
55
59
virtual
~psEndSongEvent
();
60
61
62
//From psGameEvent
63
//------------------
64
virtual
bool
CheckTrigger
();
65
virtual
void
Trigger
();
66
67
private
:
68
gemActor
* charActor;
69
csTicks startingTime;
70
};
71
72
73
//--------------------------------------------------
74
75
80
class
ServerSongManager
:
public
MessageManager
<ServerSongManager>,
public
Singleton
<ServerSongManager>
81
{
82
public
:
83
ServerSongManager
();
84
~
ServerSongManager
();
85
86
bool
Initialize
();
87
93
void
HandlePlaySongMessage(
MsgEntry
* me,
Client
* client);
94
100
void
HandleStopSongMessage(
MsgEntry
* me,
Client
* client);
101
108
void
OnStopSong(
gemActor
* charActor,
bool
isEnded);
109
119
void
StopSong(
gemActor
* charActor,
bool
skillRanking);
120
121
private
:
122
bool
isProcessedSongEnded;
123
MathScript
* calcSongPar;
124
MathScript
* calcSongExp;
125
unsigned
int
instrumentsCategory;
126
csHash<int, unsigned int> scoreRanks;
127
133
psItem
* GetEquippedInstrument(
psCharacter
* charData)
const
;
134
};
135
136
#endif // SERVER_SONG_MANAGER_H
137
psCharacter
Definition:
pscharacter.h:647
MathScript
A MathScript is a mini-program to run.
Definition:
mathscript.h:442
msgmanager.h
MsgEntry
The structure of 1 queue entry (pointer to a message)
Definition:
message.h:143
psEndSongEvent::~psEndSongEvent
virtual ~psEndSongEvent()
Destructor.
gameevent.h
gemActor
Any semi-autonomous object, either a player or an NPC.
Definition:
gem.h:1170
psEndSongEvent::psEndSongEvent
psEndSongEvent(gemActor *charActor, int songLength)
Constructor.
Client
This class collects data of a netclient.
Definition:
client.h:95
pslog::Initialize
void void Initialize(iObjectRegistry *object_reg)
ServerSongManager
This class takes care of played songs and players' ranking for musical instruments skills...
Definition:
serversongmngr.h:80
psEndSongEvent::Trigger
virtual void Trigger()
Abstract event processing function.
ScoreStatistics
This struct keeps general information about a score.
Definition:
musicutil.h:43
Singleton
Definition:
singleton.h:26
psEndSongEvent::CheckTrigger
virtual bool CheckTrigger()
Called right before a Trigger is called.
psGameEvent
All scheduled events must inherit from this class.
Definition:
gameevent.h:36
psItem
This class embodies item instances in the game.
Definition:
psitem.h:238
psEndSongEvent
This event informs the song manager when the song is over.
Definition:
serversongmngr.h:46
MessageManager
Provides a manager to facilitate subscriptions.
Definition:
msgmanager.h:106
server
serversongmngr.h
Generated on Sat Jun 19 2021 05:00:33 for Planeshift by
1.8.11