snakeplusplus/src/botinterface.hpp

27 lines
907 B
C++
Executable File

#ifndef BOTINTERFACE_HPP
#define BOTINTERFACE_HPP
#include "common.hpp"
#include <stack>
#include <vector>
#include <SFML/System/Vector2.hpp>
namespace snakeplusplus
{
class AISnake {
public:
std::stack<sf::Vector2f> path;
AISnake();
void GetNewPath(const std::vector< std::vector<char> >& gameBoard, const sf::Vector2f& source, const sf::Vector2f& boundaries, const int snakeSize);
PlayerDirection GetInput(const sf::Vector2f* source);
void UpdateProbability(int snakeSize);
private:
double probabilityBFS = 1.000;
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);
};
}
#endif