snakeplusplus/src/botinterface.hpp

27 lines
907 B
C++
Raw Normal View History

#ifndef BOTINTERFACE_HPP
#define BOTINTERFACE_HPP
#include "common.hpp"
2023-10-13 19:07:08 -05:00
#include <stack>
#include <vector>
#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);
void UpdateProbability(int snakeSize);
2023-10-13 19:22:11 -05:00
private:
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
};
}
#endif