2023-08-19 12:56:40 -05:00
|
|
|
#ifndef BOTINTERFACE_HPP
|
|
|
|
#define BOTINTERFACE_HPP
|
|
|
|
|
|
|
|
#include "common.hpp"
|
2023-10-13 19:07:08 -05:00
|
|
|
#include <stack>
|
|
|
|
#include <vector>
|
2023-08-19 12:56:40 -05:00
|
|
|
#include <SFML/System/Vector2.hpp>
|
|
|
|
|
|
|
|
namespace snakeplusplus
|
|
|
|
{
|
2023-10-13 19:07:08 -05:00
|
|
|
class AISnake {
|
|
|
|
public:
|
|
|
|
std::stack<sf::Vector2f> path;
|
|
|
|
AISnake();
|
2023-10-13 19:22:11 -05:00
|
|
|
void GetNewPath(const std::vector< std::vector<char> >& gameBoard, const sf::Vector2f& source, const sf::Vector2f& boundaries, const int snakeSize);
|
2023-10-13 19:07:08 -05:00
|
|
|
PlayerDirection GetInput(const sf::Vector2f* source);
|
2023-10-24 00:54:30 -05:00
|
|
|
void UpdateProbability(int snakeSize);
|
2023-10-13 19:22:11 -05:00
|
|
|
private:
|
2023-10-24 00:54:30 -05:00
|
|
|
double probabilityBFS = 1.000;
|
2023-10-13 19:22:11 -05:00
|
|
|
std::stack<sf::Vector2f> botPathUnsanitized;
|
|
|
|
void BFS(const std::vector< std::vector<char> >& gameBoard, const sf::Vector2f& source, const sf::Vector2f& boundaries);
|
|
|
|
void DFS(const std::vector< std::vector<char> >& gameBoard, const sf::Vector2f& source, const sf::Vector2f& boundaries);
|
2023-10-13 19:07:08 -05:00
|
|
|
};
|
2023-08-19 12:56:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|