| 1 |
#ifndef _CPLAYSOUNDEVENT_ |
| 2 |
#define _CPLAYSOUNDEVENT_ |
| 3 |
|
| 4 |
#include "CSequencedEvent.h" |
| 5 |
#include "CSoundSystem.h" |
| 6 |
#include "CSound.h" |
| 7 |
|
| 8 |
class CPlaySoundEvent : public CSequencedEvent |
| 9 |
{ |
| 10 |
public: |
| 11 |
CPlaySoundEvent(CSound &s, CSoundSystem &sm, bool concurrent = true) : CSequencedEvent(concurrent), s(s), sm(sm) {} |
| 12 |
|
| 13 |
CPlaySoundEvent* getCopy() { return new CPlaySoundEvent(*this); } |
| 14 |
|
| 15 |
void doUpdate() { sm.playSound(s); setDone(); } |
| 16 |
|
| 17 |
private: |
| 18 |
CSound &s; |
| 19 |
CSoundSystem &sm; |
| 20 |
}; |
| 21 |
|
| 22 |
#endif |