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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144 | /********************************************************************
*
* File: fsCPickListGui.h
*
* Purpose: Selects and displays entities required for collection.
* Controls PickListEntry children.
*
*********************************************************************/
#ifndef gfCPickListGuihdr
#define gfCPickListGuihdr
#include <vector>
#include <fsCore/src/fsCUniqueId.h>
#include <fsAppCore/src/components/gui/fsIMessageListenerGuiComponent.h>
class gfIPickListEntryGui;
class gfCTaskComponent;
class gfCPickListGui : public fsIMessageListenerGuiComponent
{
friend class fsCComponentFactory;
public:
const std::vector<gfIPickListEntryGui*> entriesGet() const;<--- Function 'entriesGet()' should return member 'mEntries' by const reference.
gfIPickListEntryGui* entryLocate(const fsStr& pLocalisedEntName) const;
static const fsCUniqueId mTypeId;
virtual ~gfCPickListGui() = default;
protected:
void serialiseDo() override;
void deserialiseDo() override;
void postLoadDo() override;
void listenersDeregisterDo() override;
void listenersRegisterDo() override;
fsBool messageProcessDo(const fsCUniqueId& pMessageType,
const fsIMessageDispatcher::sMessageParameters& pParam) override;
void initialiseFromVariableTableDo(const fsCVariableTable& pVars) override;
static fsIComponent* create(fsCEntity* pParent);
gfCPickListGui(fsCEntity* pParent);
private:
class fsSEntityTypes
{
public:
void tagAdd(fsStr const& pTag);
void typeAdd(const std::type_info* pType);
std::vector<fsCEntity*> entitiesGet() const;
private:
std::vector<const std::type_info*> mEntityTypes;
std::vector<fsStr> mTags;
};
void levelDataInitialise(const fsCVariableTable& pLevelSettings);
void totEntitiesToCollectSet(fsS32 pTotEntities);
void repeatedHOGItemCollectionCountSet(fsS32 pSize) { mRepeatedHOGItemCount = pSize; }
void updateDo(fsS32 pDeltaMs) override;
void reset();
static void chooseEntsWithMatchingNameAndStripFromCollectableCollection(
std::vector<fsCEntity*>& pCollectableCollection,
std::vector<fsCEntity*>& pChosenEntities, std::vector<fsCEntity*>::iterator& pEntIt, const fsStr& pMatch);
void entitiesRelinkWithGuiSlots();
std::vector<fsCEntity*> collectableEntitesGet() const;
fsS32 allEntitiesCountGet() const;
static fsS32 numUniqueEntityNamesGet(const std::vector<fsCEntity*>& pEnts);
void itemCountUpdate() const;
fsBool hintActivate();
std::vector<fsCEntity*> hintableEntitiesGet() const;
std::vector<fsCEntity*> draggableEntitiesGet() const;
void completionRequirementClear() const;
void completionRequirementRegister() const;
void listCompleteProcess();
void updateCollectionCount();
void slotsGather();
void entityTypesGather(fsSEntityTypes& pTypes, fsStr pEntsStr);
fsU32 availableSlotsCount() const;
void entityAddToList();
std::vector<fsCEntity*> entityOfTypesGet(fsSEntityTypes const& pTypes) const;
static void collectedEntitiesRemove(std::vector<fsCEntity*>& pCandidateEntities);
static void nonCollectableEntitiesRemove(std::vector<fsCEntity*>& pCandidateEntities);
static void entitiesWithSameTextGet(std::vector<fsCEntity*>& pChosenEntities,
const std::vector<fsCEntity*>& pShuffledEntities);
gfIPickListEntryGui* randomAvailableSlotGet() const;
void taskEntityRegisterWithRollOver(gfCTaskComponent* pTaskComponent, fsCEntity* pSlot);
void listSetupHandle();
void listCompletedHandle();
std::vector<gfIPickListEntryGui*> mEntries;
fsSEntityTypes mPriorityEntityTypes;
fsSEntityTypes mRandomEntityTypes;
fsS32 mNextNewEntryDelay;
fsS32 mRepeatedHOGItemCount;
fsS32 mTotEntitiesToCollect;
fsS32 mTotEntitiesAddedToList;
fsBool mGroupEntitiesByName;
fsBool mRequiredForActCompletion;
fsS32 mNumEntitiesCollected;
fsBool mOrdered;
fsBool mHideWhenDone;
fsBool mLevelSkipped;
#if !defined fsRELEASE
fsBool mWarnedAboutLackOfItems;
#endif
};
#endif
|