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 pieces of minigames that can aim their own moves
51 // (gfIMinigameNextMove); nullptr when there are none.
53 const std::vector<fsCEntity*>& aimedPiecesGet() const { return mAimedPieces; }
54 // Pieces of those minigames that are tapped, not dragged - blind taps already reach them.
55 const std::vector<fsCEntity*>& tapAimedPiecesGet() const { return mTapAimedPieces; }
56 // Pieces of minigames where blind input only does harm.
57 const std::vector<fsCEntity*>& aimOnlyPiecesGet() const { return mAimOnlyPieces; }
58
59private:
60
61 fsPoint randomPointGet() const;
62
63 const fsIComponent& mOwner;
64
65 // Cell size, and the band left clear of the top and bottom Gui bars.
66 const fsS32 mPitch;
67 const fsS32 mYMin;
68 fsS32 mYMax;
69
70 fsS32 mColumns;
71 fsS32 mCellCount;
72 // Coprime to the cell count, so a pass still visits every cell exactly once.
73 fsS32 mStride;
74 fsS32 mIndex;
75 const fsS32 mSkipLimit;
76
77 // Pieces already home. Tapping one picks it back up and undoes the progress.
78 std::vector<fsCEntity*> mCompletedPieces;
79 // A tap rotates a jigsaw piece, so only a drag moves one towards home.
80 std::vector<fsCEntity*> mAimedPieces;
81 std::vector<fsCEntity*> mTapAimedPieces;
82 std::vector<fsCEntity*> mAimOnlyPieces;
83 fsS32 mAimedCursor;
84};
85
86#endif
Definition fsCEntity.h:39
Definition fsIComponent.h:26
fsPoint pointNextGet()
Definition gfCAutoTestSweep.cpp:100
fsBool allowedPointNextGet(fsPoint &pPoint)
Definition gfCAutoTestSweep.cpp:113
const std::vector< fsCEntity * > & aimOnlyPiecesGet() const
Definition gfCAutoTestSweep.h:57
fsBool randomPointOutsideGet(fsCEntity *pEnt, fsPoint &pPoint) const
Definition gfCAutoTestSweep.cpp:149
static fsCEntity * currentSubSceneEntGet()
Definition gfCAutoTestSweep.cpp:33
fsBool tapAllowedGet(const fsPoint &pPos) const
Definition gfCAutoTestSweep.cpp:178
fsCEntity * aimedPieceNextGet()
Definition gfCAutoTestSweep.cpp:205
gfCAutoTestSweep(const fsIComponent &pOwner, fsS32 pPitch, fsS32 pSkipLimit)
Definition gfCAutoTestSweep.cpp:216
fsCEntity * openSubSceneEntGet() const
Definition gfCAutoTestSweep.cpp:165
void geometryInit()
Definition gfCAutoTestSweep.cpp:44
const std::vector< fsCEntity * > & tapAimedPiecesGet() const
Definition gfCAutoTestSweep.h:55
void sceneRefresh()
Definition gfCAutoTestSweep.cpp:68
fsBool randomAllowedPointGet(fsPoint &pPoint) const
Definition gfCAutoTestSweep.cpp:135
const std::vector< fsCEntity * > & aimedPiecesGet() const
Definition gfCAutoTestSweep.h:53
bool fsBool
Definition fsBaseTypes.h:26
int fsS32
Definition fsBaseTypes.h:20
Definition fsPoint.h:17