-
Notifications
You must be signed in to change notification settings - Fork 1
/
TetrizAI_Expand.h
37 lines (29 loc) · 951 Bytes
/
TetrizAI_Expand.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
class GameState;
class Board;
class FallMino;
class Node;
#include "TetrizAI_Common.h"
constexpr int MAX_CHILDREN = 100;
constexpr int MAX_BABYS = 300;
class ExpandAI {
public:
[[nodiscard]] int ExpandNode(const GameState *parentGame, Node *childNode);
ExpandAI();
~ExpandAI();
ExpandAI(const ExpandAI &) = delete;
ExpandAI &operator=(const ExpandAI &) = delete;
private:
class ExpandAI::BabyNode {
public:
FallMino fallingMino;
Command commands;
HoldMino hold;
NextIterator nextIt;
};
BabyNode bN[MAX_BABYS];
BabyNode *babyNode;
[[nodiscard]] int ExpandBaseNode(BabyNode *babyNode, int childCount, const Board *parentBoard);
[[nodiscard]] int ExpandDeriveNode(BabyNode *babyNode, int childCount, const Board *parentBoard, const int columnHeight[]);
[[nodiscard]] int RegisterChildNode(BabyNode *babyNode, int childCount, const GameState *parentGame, Node *childNode);
};