CStunnable.h 950 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
/*
 * CStunnable.h
 *
 *  Created on: 23.06.2011
 *      Author: gerstrong
 */

#ifndef CSTUNNABLE_H_
#define CSTUNNABLE_H_

11
#include "engine/galaxy/CGalaxySpriteObject.h"
Gerstrong's avatar
Gerstrong committed
12
#include "engine/galaxy/ai/CBullet.h"
Gerhard Stein's avatar
Gerhard Stein committed
13
#include <map>
Gerstrong's avatar
Gerstrong committed
14 15 16

namespace galaxy
{
17

Gerhard Stein's avatar
Gerhard Stein committed
18
class CStunnable: public CGalaxySpriteObject
Gerhard Stein's avatar
Gerhard Stein committed
19
{
20
public:
21 22
	CStunnable(CMap *pmap,
				const Uint16 foeID,
Gerstrong's avatar
Gerstrong committed
23
				Uint32 x,
24
				Uint32 y );
Gerstrong's avatar
Gerstrong committed
25 26

	/**
Gerstrong's avatar
Gerstrong committed
27
	 * What happens when some objects gets touched, or normally shot
Gerstrong's avatar
Gerstrong committed
28
	 */
29
	virtual void getTouchedBy(CSpriteObject &theObject);
Gerstrong's avatar
Gerstrong committed
30

Gerstrong's avatar
Gerstrong committed
31 32 33 34 35 36
	/**
	 * This happens when the object gets shot.
	 * The Starring appears when it hits the floor
	 */
	void processGettingStunned();

Gerstrong's avatar
Gerstrong committed
37
	/**
Gerstrong's avatar
Gerstrong committed
38
	 * empty cycle which is processed when the object is stunned
Gerstrong's avatar
Gerstrong committed
39
	 */
Gerstrong's avatar
Gerstrong committed
40
	void processStunned();
Gerstrong's avatar
Gerstrong committed
41

Gerhard Stein's avatar
Gerhard Stein committed
42 43
	void setActionForce(const size_t ActionNumber);

Gerstrong's avatar
Gerstrong committed
44 45 46
protected:
	bool m_stunned;
	void (CStunnable::*mp_processState)();
Gerhard Stein's avatar
Gerhard Stein committed
47
	std::map< size_t, void (CStunnable::*)() > mActionMap;
48 49
};

Gerstrong's avatar
Gerstrong committed
50 51
}

52
#endif /* CSTUNNABLE_H_ */