cmpsc330hw5/ss.h

37 lines
985 B
C
Raw Permalink Normal View History

2024-12-07 00:04:43 +00:00
#ifndef HW4_STRATEGIC_PLAYER1_H
#define HW4_STRATEGIC_PLAYER1_H
#include "common.h"
#include "board.h"
#include "player.h"
2024-12-07 00:06:23 +00:00
#include <vector>
2024-12-07 01:40:19 +00:00
#include <limits>
2024-12-07 00:04:43 +00:00
class StrategicPlayer1 : public IPlayer {
char name;
char box_name;
Board board;
public:
string PlayerInfo() override;
void Init(int board_rows, int board_cols, char box_type, char line_type) override;
void Close() override;
void EventAddLine(char bar, const Loc& loc) override;
void EventAddBox(char box, const Loc& loc) override;
Loc SelectLineLocation() override;
int EvaluateMoveCost(int row, int col);
int CountBoxLines(int row, int col);
Loc FindOptimalMove();
void ListEmptyLines(vector<Loc>& empty_lines);
bool DoesMoveCompleteBox(int row, int col);
Loc FindBoxCompletingMove();
2024-12-07 01:40:19 +00:00
bool DoesMoveCreateChain(int row, int col);
Loc ForceOpponentMistake(const vector<Loc>& empty_lines);
2024-12-07 00:04:43 +00:00
~StrategicPlayer1();
};
#endif // HW4_STRATEGIC_PLAYER1_H