File size: 1,474 Bytes
24b81cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class SoundEventBase
{
	AbstractWave 	m_SoundSetCallback;
	int 			m_Type;
	int 			m_ID;
	int 			m_SoundVoiceAnimEventClassID;
	bool 			m_RequestDestroy;
	string 			m_SoundSetNameRoot;
	bool 			m_SkipForControlledCharacter;
	int				m_Param;
	
	
	void ~SoundEventBase()
	{
		if(m_SoundSetCallback) m_SoundSetCallback.Stop();
	}
	
	//obsolete function, now possible to set a param
	bool IsSkipForControlled()
	{
		return m_SkipForControlledCharacter;
	}
	
	void Tick()
	{
		if(!m_SoundSetCallback)
		{
			m_RequestDestroy = true;
		}
	}
	
	bool IsSoundCallbackExist()
	{
		if( m_SoundSetCallback )
		{
			return true;
		}
		
		return false;
	}
	
	bool IsDestroyRequested()
	{
		return m_RequestDestroy;
	}
	
	bool CanPlay()
	{
		return true;
	}
	
	bool Play()
	{
		return true;
	}
	
	void OnPlay(PlayerBase player);
	
	void Stop()
	{
		if(m_SoundSetCallback) 
		{
			m_SoundSetCallback.Stop();
		}
	}	

	int GetSoundEventID()
	{
		return m_ID;
	}

	int GetSoundEventType()
	{
		return m_Type;
	}
	
	AbstractWave GetSoundSetCallback()
	{
		return m_SoundSetCallback;
	}
}

class SoundEventHandler
{
	static int GetSoundEventType(int id) { return -1; }
	//void OnTick(float delta_time) {}
	bool PlayRequest(EPlayerSoundEventID id, bool sent_from_server = false) { return true; }
	bool PlayRequestEx(EPlayerSoundEventID id, bool sent_from_server = false, int param = 0){ return true; };
	int GetCurrentStateEventID() { return -1; }
	int GetCurrentStateEventType() { return -1; }
}