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
/********************************************************************
*
*	File:		gfCInstantInventoryMiniGameLogicComponent.h
*
*	Purpose:	Logic component added to a scene to control the
*				instant inventory entities as a mini game - need to
*				track them and reset if required
*
*********************************************************************/

#ifndef gfCInstantInventoryMiniGameLogicComponenthdr
#define gfCInstantInventoryMiniGameLogicComponenthdr

#include "../gfIMinigameLogic.h"


class gfCInstantInventoryMiniGameLogicComponent : public gfIMinigameLogic
{
	friend class fsCComponentFactory;

public:

	static const fsCUniqueId mTypeId;

protected:

	void skipDo() override;

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

	void resetDo() override;
	void deserialiseDo() override;
	void serialiseDo() override;

	void initialiseFromVariableTableDo(const fsCVariableTable& pVars) override;

	static fsIComponent* create(fsCEntity* pParent);

	gfCInstantInventoryMiniGameLogicComponent(fsCEntity* pParent);
	virtual ~gfCInstantInventoryMiniGameLogicComponent();<--- Destructor in derived class

private:

	void locksBreakAndKeysConsume();

	void instantInventoryEntsCollect();

	void completionMessageSend(fsBool pComplete) const;
	void completionRequirementRegister() const;

	fsBool mSkip;
	fsBool mReset;
	fsS32 mLocksBroken;

	std::vector<fsCEntity*> mInstantInventoryEnts;
	std::vector<fsCEntity*> mLockEnts;
};

#endif