Fission FSN
Loading...
Searching...
No Matches
gfCAutoTestSweep.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: gfCAutoTestSweep.h
4*
5* Purpose: Auto play blind coverage - where a tap may land
6*
7*********************************************************************/
8
9#ifndef gfCAutoTestSweephdr
10#define gfCAutoTestSweephdr
11
12#include <vector>
13
14#include <fsCore/fsBaseTypes.h>
15#include <fsCore/fsPoint.h>
16
17class fsCEntity;
18class fsIComponent;
19
20
21// A jittered walk over a cell grid, barred from places a blind tap must not
22// land. It knows nothing about targets - that is gfCAutoTestAim's job.
24{
25public:
26
27 gfCAutoTestSweep(const fsIComponent& pOwner, fsS32 pPitch, fsS32 pSkipLimit);
28
29 // The sub-scene the player is in - input cannot reach anything outside it.
31
32 // Sized from the current display, so call per level.
33 void geometryInit();
34 // Rebuilds the minigame piece lists. A scene walk - once a step, not per tap.
35 void sceneRefresh();
36
37 // Advances the sweep, allowed or not.
39 // Walks the sweep on past barred points, up to the skip limit.
42 // A random point outside pEnt's sprite.
43 fsBool randomPointOutsideGet(fsCEntity* pEnt, fsPoint& pPoint) const;
44
45 fsBool tapAllowedGet(const fsPoint& pPos) const;
46
47 // The visible exit of an open sub-scene, which closes it on a tap outside.
49
50 // Round robin over loose jigsaw pieces; nullptr when there are none.
52 const std::vector<fsCEntity*>& jigsawPiecesGet() const { return mJigsawPieces; }
53
54private:
55
56 fsPoint randomPointGet() const;
57
58 const fsIComponent& mOwner;
59
60 // Cell size, and the band left clear of the top and bottom Gui bars.
61 const fsS32 mPitch;
62 const fsS32 mYMin;
63 fsS32 mYMax;
64
65 fsS32 mColumns;
66 fsS32 mCellCount;
67 // Coprime to the cell count, so a pass still visits every cell exactly once.
68 fsS32 mStride;
69 fsS32 mIndex;
70 const fsS32 mSkipLimit;
71
72 // Pieces already home. Tapping one picks it back up and undoes the progress.
73 std::vector<fsCEntity*> mCompletedPieces;
74 // A tap rotates a jigsaw piece, so only a drag moves one towards home.
75 std::vector<fsCEntity*> mJigsawPieces;
76 fsS32 mJigsawCursor;
77};
78
79#endif
Definition fsCEntity.h:39
Definition fsIComponent.h:26
fsPoint pointNextGet()
Definition gfCAutoTestSweep.cpp:86
fsBool allowedPointNextGet(fsPoint &pPoint)
Definition gfCAutoTestSweep.cpp:99
fsCEntity * jigsawPieceNextGet()
Definition gfCAutoTestSweep.cpp:191
fsBool randomPointOutsideGet(fsCEntity *pEnt, fsPoint &pPoint) const
Definition gfCAutoTestSweep.cpp:135
static fsCEntity * currentSubSceneEntGet()
Definition gfCAutoTestSweep.cpp:33
fsBool tapAllowedGet(const fsPoint &pPos) const
Definition gfCAutoTestSweep.cpp:164
gfCAutoTestSweep(const fsIComponent &pOwner, fsS32 pPitch, fsS32 pSkipLimit)
Definition gfCAutoTestSweep.cpp:202
fsCEntity * openSubSceneEntGet() const
Definition gfCAutoTestSweep.cpp:151
const std::vector< fsCEntity * > & jigsawPiecesGet() const
Definition gfCAutoTestSweep.h:52
void geometryInit()
Definition gfCAutoTestSweep.cpp:44
void sceneRefresh()
Definition gfCAutoTestSweep.cpp:68
fsBool randomAllowedPointGet(fsPoint &pPoint) const
Definition gfCAutoTestSweep.cpp:121
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
Definition fsPoint.h:17