36 lines
625 B
C++
36 lines
625 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
|
|
class PlayerCursor {
|
|
private:
|
|
std::vector<unsigned int> rows;
|
|
sf::Vector2u position;
|
|
int leftDAS;
|
|
int rightDAS;
|
|
int upDAS;
|
|
int downDAS;
|
|
|
|
public:
|
|
PlayerCursor(std::vector<unsigned int> rows);
|
|
|
|
void updatePosition();
|
|
|
|
void goToPosition(const sf::Vector2u& newPosition);
|
|
|
|
const sf::Vector2u& getPosition() const;
|
|
|
|
private:
|
|
bool shouldMove(int DAS) const;
|
|
|
|
void moveLeft();
|
|
|
|
void moveRight();
|
|
|
|
void moveUp();
|
|
|
|
void moveDown();
|
|
};
|