Fission FSN
Loading...
Searching...
No Matches
gfICollectableComponent.h
Go to the documentation of this file.
1/********************************************************************
2**
3* File: gfICollectableComponent.h
4*
5* Purpose: Entities which can be collected by various methods.
6*
7*********************************************************************/
8
9#ifndef gfICollectableComponenthdr
10#define gfICollectableComponenthdr
11
15
16
18{
19 friend class fsCComponentFactory;
20
21public:
22
25
27
28 void visiblePostCollectionSet(const fsStr& pPostCollectionMarkerFile);
29
30 void deactivate();
31 void activate();
32
36
40
46
47 // Extension point for a consuming genre core (e.g. gfHogCore) to add its
48 // own extra "this entity is persistent" tag checks without this generic
49 // component needing to know about that genre's entity-tag prefixes.
50 static void extraPersistentTagCheckProviderSet(fsBool (*pProvider)(fsCEntity* const pEntity));
51
52protected:
53
61
62 void stateSet(eCOLLECTION_STATE pState);
64
65 virtual void midCollectionHandle();
66 virtual fsBool inInactivatedGetDo() const;
67 virtual void onCollectionEffectCompleteDo();
68 virtual void collectionProcessTriggerDo();
69
70 void tutorialCompletedDo(const fsPoint& pPos) override;
71
72 void serialiseDo() override;
73 void deserialiseDo() override;
74 void resetDo() override;
75
76 void listenersRegisterDo() override;
77 void listenersDeregisterDo() override;
78 fsBool messageProcessDo(const fsCUniqueId& pMessageType,
79 const fsIMessageDispatcher::sMessageParameters& pParam) override;
80
83
84private:
85
86 fsBool instantCollection(std::vector<fsCEntity*> pCollectionEnts) const;
87 fsBool collectionProcessComplete() const;
88
89 fsBool persistentParentEntity() const;
90
91 fsStr postCollectionMarkerNameGet() const;
92 void postCollectionMarkerAdd();
93
94 fsBool parentContainsNoMandatedCollectableComponents();
95 void onCollectionEffectComplete();
96
97 fsStr postCollectionLayerParticleEffectFileNameGet() const;
98 void postCollectionParticleEffectEnable() const;
99 void createdEffectDisable(const fsStr& pEntName);
100 fsCEntity* const createdEffectEntGet(const fsStr& pEntName);
101
102 virtual void activateDo() {}
103 virtual void deactivateDo() {}
104
105 eCOLLECTION_STATE mState;
106 fsS32 mNumActiveCollectionEffects;
107
108 fsBool mCollectionProcessShortCircuited;
109 fsBool mPostCollectionEffectHide;
110 fsBool mVisiblePostCollection;
111 fsStr mPostCollectionMarkerFile;
112};
113
114#endif
Definition fsCEntity.h:39
Definition fsCUniqueId.h:21
fsIMessageListenerComponent(fsCEntity *pParent)
Definition fsIMessageListenerComponent.cpp:9
fsITutorialEnabledComponent()
Definition fsITutorialEnabledComponent.cpp:17
Definition fsStr.h:23
fsBool messageProcessDo(const fsCUniqueId &pMessageType, const fsIMessageDispatcher::sMessageParameters &pParam) override
Definition gfICollectableComponent.cpp:144
void stateSet(eCOLLECTION_STATE pState)
Definition gfICollectableComponent.cpp:44
void visiblePostCollectionSet(const fsStr &pPostCollectionMarkerFile)
Definition gfICollectableComponent.cpp:72
void resetDo() override
Definition gfICollectableComponent.cpp:54
virtual ~gfICollectableComponent()
Definition gfICollectableComponent.cpp:391
virtual fsBool inInactivatedGetDo() const
Definition gfICollectableComponent.cpp:293
friend class fsCComponentFactory
Definition gfICollectableComponent.h:19
void tutorialCompletedDo(const fsPoint &pPos) override
Definition gfICollectableComponent.cpp:62
fsBool playCollectedSFX()
Definition gfICollectableComponent.cpp:326
void collectionShortCircuit()
Definition gfICollectableComponent.cpp:188
void listenersDeregisterDo() override
Definition gfICollectableComponent.cpp:99
void activate()
Definition gfICollectableComponent.cpp:281
void serialiseDo() override
Definition gfICollectableComponent.cpp:81
fsBool collectionEffectPlayingGet() const
Definition gfICollectableComponent.cpp:303
static void extraPersistentTagCheckProviderSet(fsBool(*pProvider)(fsCEntity *const pEntity))
Definition gfICollectableComponent.cpp:33
virtual void collectionProcessTriggerDo()
Definition gfICollectableComponent.cpp:347
fsBool isInactivatedGet() const
Definition gfICollectableComponent.cpp:288
virtual void onCollectionEffectCompleteDo()
Definition gfICollectableComponent.cpp:263
void listenersRegisterDo() override
Definition gfICollectableComponent.cpp:112
void collectionProcessTrigger()
Definition gfICollectableComponent.cpp:39
gfICollectableComponent(fsCEntity *pParent)
Definition gfICollectableComponent.cpp:380
void deactivate()
Definition gfICollectableComponent.cpp:270
eCOLLECTION_STATE
Definition gfICollectableComponent.h:55
@ eCOLLECTIBLE
Definition gfICollectableComponent.h:57
@ eINACTIVE
Definition gfICollectableComponent.h:56
@ eCOLLECTED_EFFECT_FINISHED
Definition gfICollectableComponent.h:59
@ eCOLLECTED_EFFECT_PLAYING
Definition gfICollectableComponent.h:58
static const fsCUniqueId mCollectionEndMsg
Definition gfICollectableComponent.h:38
void deserialiseDo() override
Definition gfICollectableComponent.cpp:86
eCOLLECTION_STATE stateGet() const
Definition gfICollectableComponent.cpp:49
virtual void midCollectionHandle()
Definition gfICollectableComponent.cpp:135
static const fsCUniqueId mCollectionStartMsg
Definition gfICollectableComponent.h:37
fsBool hasBeenCollectedGet() const
Definition gfICollectableComponent.cpp:298
static const fsCUniqueId mLevelSkipForceCollectMsg
Definition gfICollectableComponent.h:39
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
Definition fsIMessageDispatcher.h:32
Definition fsPoint.h:17
fsCEntity * mEnt
Definition gfICollectableComponent.h:44
sEntityCollectedParam(fsCEntity *pEnt)
Definition gfICollectableComponent.h:43