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
/********************************************************************
*
*	File:		gfIOpaqueLensComponent.h
*
*	Purpose:	Interface class for all screen type interactions
*				Used as cover over normal game objects to control
*				user input and pass it on down the line
*
*********************************************************************/

#ifndef gfIOpaqueLensComponenthdr
#define gfIOpaqueLensComponenthdr

#include "gfILensComponent.h"

struct fsPoint;


class gfIOpaqueLensComponent : public gfILensComponent
{
public:

	struct fsSSwipe
	{
		fsSSwipe() :
			mStart(fsPoint{0, 0}),
			mEnd(fsPoint{0, 0}),
			mActive(false)
		{
		}

		fsPoint mStart;
		fsPoint mEnd;
		fsBool mActive;
	};

	struct fsSTap
	{
		fsSTap() :
			mPos(fsPoint{0, 0}),
			mActive(false)
		{
		}

		fsPoint mPos;
		fsBool mActive;
	};

	fsSTap& tapGet() { return mLastTap; }
	fsSSwipe const& swipeGet() const { return mSwipe; }

	virtual ~gfIOpaqueLensComponent();<--- Destructor in derived class

protected:

	void initialiseDo() override;

	void doOnTap(const fsPoint& pTapPos) override;

	void doOnDragStart(const fsPoint& pStartPos) override;
	void doOnDragMove(const fsPoint& pCurrPos) override;
	void doOnDragEnd(const fsPoint& pEndPos) override;

	gfIOpaqueLensComponent(fsCEntity* pParent, fsBool pHandleTaps, fsBool pHandleDragEvent, fsBool pHandlePinchEvents);

private:

	fsSSwipe mSwipe;
	fsSTap mLastTap;
};

#endif