22 #ifndef NANCY_ACTION_PEGSPUZZLE_H 23 #define NANCY_ACTION_PEGSPUZZLE_H 25 #include "engines/nancy/commontypes.h" 26 #include "engines/nancy/action/puzzlerecord.h" 27 #include "engines/nancy/action/mousefollow.h" 50 void execute()
override;
53 bool isViewportRelative()
const override {
return true; }
56 Common::String getRecordTypeName()
const override {
return "PegsPuzzle"; }
58 enum CellState : byte { kPeg = 0, kEmpty = 1, kBlocked = 2 };
60 int cellIndex(
int col,
int row)
const {
return col + row * 8; }
61 bool validCell(
int col,
int row)
const;
64 bool canJump(
int col,
int row,
int dCol,
int dRow,
int &destCol,
int &destRow)
const;
66 bool isCarriedTarget(
int col,
int row)
const;
68 bool cellAtCursor(
const Common::Point &mousePos,
int &outCol,
int &outRow)
const;
69 bool cellHasAnyMove(
int col,
int row)
const;
70 bool anyMovesLeft()
const;
72 void doJump(
int fromCol,
int fromRow,
int destCol,
int destRow);
74 void carryPeg(
int col,
int row,
NancyInput &input);
79 uint16 _hoverCursorType = 0;
80 uint16 _dragCursorType = 0;
81 byte _startEmptyFlag = 0;
82 byte _startEmptyPos = 0;
83 byte _targetPegCount = 0;
91 uint16 _pitchYBias = 0;
92 uint16 _pitchXBias = 0;
93 uint16 _numBlocked = 0;
102 int _carriedCol = -1;
103 int _carriedRow = -1;
106 bool _solved =
false;
107 bool _exitRequested =
false;
116 #endif // NANCY_ACTION_PEGSPUZZLE_H
Definition: commontypes.h:186
Definition: pegspuzzle.h:42
Definition: puzzlerecord.h:37
Definition: commontypes.h:306
Definition: mousefollow.h:50
Definition: actionmanager.h:32