ScummVM API documentation
beehive.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  *
21  * This file is dual-licensed.
22  * In addition to the GPLv3 license mentioned above, MojoTouch has exclusively licensed
23  * this code on November 10th, 2021, to be use in closed-source products.
24  * Therefore, any contributions (commits) to it will also be dual-licensed.
25  *
26  */
27 
28 #ifndef GROOVIE_LOGIC_BEEHIVE_H
29 #define GROOVIE_LOGIC_BEEHIVE_H
30 
31 #include "common/system.h"
32 
33 namespace Groovie {
34 
35 /*
36  * Beehive (Blood and Honey) puzzle (hs.grv)
37  *
38  * An infection-style game in which the player must cover more
39  * territory than the computer. It's similar to the microscope puzzle
40  * in the 7th Guest. The playfield is a honeycomb made of 61
41  * hexagons. The hexagons are numbered starting from the top-left
42  * corner, with a direction from bottom left to top right.
43  */
44 class BeehiveGame {
45 public:
46  BeehiveGame(bool easierAi) {
47 #if 0
48  _easierAi = false;
49  tests();
50 #endif
51  _easierAi = easierAi;
52  }
53  ~BeehiveGame() {}
54 
55  void run(byte *scriptVariables);
56 
57 private:
58  void sub02(int8 *a1, int8 *a2);
59  void sub04(int8 a1, int8 a2, int8 *scriptVariables);
60  void calcSamanthaMove(int8 *a1, int8 *a2, int8 *a3, int8 *a4, int8 *a5, int8 *a6);
61  void calcStaufMove(int8 *a1, int8 *a2, int8 *a3, int8 *a4, int8 *a5, int8 *a6);
62  int8 sub11(int8 *beehiveState, int8 *a2, int8 *a3, int8 *a4, int8 a5, int8 a6, int8 *a7);
63  int8 sub12(int8 *beehiveState, int8 a2, int8 a3, int8 a4);
64  int8 sub13(int8 *beehiveState, int8 a2, int8 a3);
65  void sub15(int8 *beehiveState, int8 a2, int8 *a3);
66  void sub16(int8 a1, int8 a2, int8 *a3, int8 *a4, int8 *a5);
67  void sub17(int8 *beehiveState, int8 a2, int8 *a3, int8 *a4, int8 *a5);
68  void selectSourceHexagon(int8 a1, int8 *a2, int8 *a3);
69  int8 sub19(int8 a1, int8 a2);
70  int8 getHexDifference();
71  int8 getTotal(int8 *hexagons);
72  int8 calcMove(int8 *beehiveState, int8 a2, int8 a3, int8 depth, int a5, int8 *a6);
73  int8 findCell(int8 *beehiveState, int8 *pos, int8 key);
74  void testGame(Common::Array<int> moves, bool playerWin);
75  void tests();
76  void overrideClick(byte *vars);
77  void overrideMove(byte *vars);
78 
79  #define HEXCOUNT 61
80  int8 _beehiveState[HEXCOUNT];
81 
82  Common::Array<int> overrideMoves;
83  uint overrideIndex;
84  bool _easierAi;
85  int8 _maxDepth;
86 };
87 
88 } // End of Groovie namespace
89 
90 #endif // GROOVIE_LOGIC_BEEHIVE_H
Definition: beehive.h:44
Definition: cursor.h:32