Fission FSN
Loading...
Searching...
No Matches
gfCWordHuntMinigameLogicComponent.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: gfCWordHuntMinigameLogicComponent.h
4*
5* Purpose: Logic for Word Hunt - a dense board of letter tiles
6* where each word is traced through touching tiles,
7* turning as it goes
8*
9*********************************************************************/
10
11#ifndef gfCWordHuntMinigameLogicComponenthdr
12#define gfCWordHuntMinigameLogicComponenthdr
13
15
16
17// Shares the word search's grid, word list, collection and save; words always snake. Found
18// words flash and clear rather than staying on the board, and hints give a letter at a time.
20{
21 friend class fsCComponentFactory;
22
23public:
24
25 static const fsCUniqueId mTypeId;
26 static const fsStr mEntityPrefix;
27
28 fsBool hintActivate() override;
29
31
32protected:
33
34 fsBool dragSelectDefaultGet() const override { return true; }
35 fsBool snakeWordsDefaultGet() const override { return true; }
36
37 void foundLinesTake(std::vector<fsCEntity*>& pLines, fsBool pFlash) override;
38 fsBool alreadyFoundCue(fsSSelection& pSelection) override;
39
40 void updateDo(fsS32 pDeltaMs) override;
41 void resetDo() override;
42
43 static fsIComponent* create(fsCEntity* pParent);
44
46
47private:
48
49 struct sFlash
50 {
51 std::vector<fsCEntity*> mLines;
52 fsS32 mElapsedMs = 0;
53 };
54
55 void flashStart(std::vector<fsCEntity*>& pLines);
56 static void linesDestroy(std::vector<fsCEntity*>& pLines);
57
58 std::vector<sFlash> mFlashes;
59
60 // The word being hinted and how many of its tiles have been given away.
61 fsStr mHintWord;
62 std::size_t mHintTilesShown = 0;
63};
64
65#endif
Definition fsCEntity.h:39
Definition fsCUniqueId.h:21
Definition fsIComponent.h:26
Definition fsStr.h:23
fsBool alreadyFoundCue(fsSSelection &pSelection) override
Definition gfCWordHuntMinigameLogicComponent.cpp:76
void foundLinesTake(std::vector< fsCEntity * > &pLines, fsBool pFlash) override
Definition gfCWordHuntMinigameLogicComponent.cpp:64
fsBool snakeWordsDefaultGet() const override
Definition gfCWordHuntMinigameLogicComponent.h:35
friend class fsCComponentFactory
Definition gfCWordHuntMinigameLogicComponent.h:21
~gfCWordHuntMinigameLogicComponent() override
Definition gfCWordHuntMinigameLogicComponent.cpp:150
gfCWordHuntMinigameLogicComponent(fsCEntity *pParent)
Definition gfCWordHuntMinigameLogicComponent.cpp:144
static const fsCUniqueId mTypeId
Definition gfCWordHuntMinigameLogicComponent.h:25
static const fsStr mEntityPrefix
Definition gfCWordHuntMinigameLogicComponent.h:26
static fsIComponent * create(fsCEntity *pParent)
Definition gfCWordHuntMinigameLogicComponent.cpp:139
fsBool dragSelectDefaultGet() const override
Definition gfCWordHuntMinigameLogicComponent.h:34
void resetDo() override
Definition gfCWordHuntMinigameLogicComponent.cpp:127
fsBool hintActivate() override
Definition gfCWordHuntMinigameLogicComponent.cpp:27
void updateDo(fsS32 pDeltaMs) override
Definition gfCWordHuntMinigameLogicComponent.cpp:105
gfCLetterGrid::sSelection fsSSelection
Definition gfCWordSearchMinigameLogicComponent.h:76
gfCWordSearchMinigameLogicComponent(fsCEntity *pParent)
Definition gfCWordSearchMinigameLogicComponent.cpp:509
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
decltype(sizeof(void *)) size_t
Definition doctest.h:524