This repository has been archived on 2023-10-10. You can view files and clone it, but cannot push or open issues/pull-requests.
Explode/tile.h

39 lines
812 B
C++

// TILE CLASS, CONTAINS GRAPHICS AND COLLISION TESTS
#ifndef TILE_H
#define TILE_H
#include <SFML/Graphics.hpp>
class Tile
{
private:
int m_Type;
bool m_Revealed;
bool m_Flagged;
int m_PosX;
int m_PosY;
public:
Tile();
~Tile();
inline int GetType() { return m_Type; }
inline void SetType(int type) { m_Type = type; }
void SetSpritePosition(int x, int y);
bool IsRevealed() { return m_Revealed; }
inline void Reveal() { m_Revealed = true; }
// used to fully reveal the tile once the game is done
inline void Finish() { m_Revealed = true; m_Flagged = false; }
// tests for collision and mechanics for processing the input
bool TestPosition(int x, int y);
bool TestClick(int x, int y);
bool TestRightClick(int x, int y);
void Render();
};
#endif