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
/********************************************************************
*
*	File:		fsCHogLevel.h
*	
*	Purpose:	Create and control game entities.
*
*********************************************************************/

#ifndef gfCSimpleLevelComponenthdr
#define gfCSimpleLevelComponenthdr

#include <vector>

#include <fsCore/fsStr.h>

#include "../gfIHogLevel.h"
#include "components/gfIMinigameLogic.h"
#include "src/fsCEntityFactory.h"

class gfCSimpleLevelComponent : public gfIHogLevel
{
	friend class fsCComponentFactory;

public:

	static const fsCUniqueId mTypeId;


	void listenersDeregisterDo() override;
	void listenersRegisterDo() override;
	fsBool messageProcessDo(const fsCUniqueId& pMessageType,
	                        const fsIMessageDispatcher::sMessageParameters& pParam) override;


protected:

	static fsIComponent* create(fsCEntity* pParent);

	void updateDo(fsS32 pDeltaMs) override;

	void actAdvanceDo() override;

	fsBool devCheatKeyTestDo(fsS32 pTypedChar) override;<--- Function in derived class
	fsBool releaseCheatKeyTest(fsS32 pTypedChar) override;

	fsBool navigateTapHandle(const fsStr& pTarget) override;

	void doLevelCreate() override;
	void doLevelStateRestore() override;

	gfCSimpleLevelComponent(fsCEntity* pParent);
	~gfCSimpleLevelComponent() override;

private:

	// map: home state choice and the test mode where tapping a state completes it
	// gfIHogLevel::mapLevelGet() compares the scene root entity name, which is always "sceneRootEntity" here
	fsBool onMapGet() const;
	void mapStateFinishedMark();
	void mapReload();
	void mapProgressReset();
	fsBool mapTapHandle(const fsStr& pState);

	fsStr mHomeConfirmState;
	fsStr mHomeConfirmMessage;
	fsBool mHomePromptShown;
};
#endif