| 1 |
#ifndef HEADER_DIALOGSTACK_H |
| 2 |
#define HEADER_DIALOGSTACK_H |
| 3 |
#define HEADER_DIALOGAGENT_H |
| 4 |
|
| 5 |
class Dialog; |
| 6 |
class ResDialogPack; |
| 7 |
class PlannedDialog; |
| 8 |
|
| 9 |
#include "NoCopy.h" |
| 10 |
|
| 11 |
#include <list> |
| 12 |
#include <string> |
| 13 |
|
| 14 |
/** |
| 15 |
* Stack of running dialogs. |
| 16 |
*/ |
| 17 |
class DialogStack : public NoCopy { |
| 18 |
private: |
| 19 |
ResDialogPack *m_dialogs; |
| 20 |
|
| 21 |
typedef std::list<PlannedDialog*> t_running; |
| 22 |
t_running m_running; |
| 23 |
t_running m_cycling; |
| 24 |
PlannedDialog *m_activeDialog; |
| 25 |
private: |
| 26 |
void removeFirstNotTalking(); |
| 27 |
bool isTalkingIn(int actor, const t_running &fifo) const; |
| 28 |
void killSoundIn(int actor, t_running &fifo); |
| 29 |
void killTalksIn(t_running &fifo); |
| 30 |
void releaseDialog(PlannedDialog *dialog); |
| 31 |
public: |
| 32 |
DialogStack(); |
| 33 |
virtual ~DialogStack(); |
| 34 |
void updateStack(); |
| 35 |
|
| 36 |
void addDialog(const std::string &name, Dialog *dialog); |
| 37 |
void actorTalk(int actor, const std::string &name, |
| 38 |
int volume, int loops=0, bool dialogFlag=false); |
| 39 |
bool isTalking(int actor) const; |
| 40 |
void killSound(int actor); |
| 41 |
|
| 42 |
bool isDialog() const; |
| 43 |
bool areRunning() const { return !m_running.empty(); } |
| 44 |
void killTalks(); |
| 45 |
void removeAll(); |
| 46 |
}; |
| 47 |
|
| 48 |
#endif |
| 49 |
|