minesweeper/src/Cell.cpp
TheRedBlueCube3 961d62ce7d initial commit
forgot the makefiles

forgor the readme

makefile crap yet again

sss
2025-06-25 20:41:39 +03:00

38 lines
514 B
C++

#include "Cell.h"
Cell::Cell(int x, int y)
: position(x, y)
{
}
Cell::Cell(Vector2 &initPos)
: position(initPos)
{
}
Cell::State Cell::getState() const
{
return state;
}
void Cell::reveal()
{
if (state != State::Flagged)
state = State::Revealed;
}
void Cell::toggleFlag()
{
state = (state == State::Flagged) ? State::Hidden : State::Flagged;
}
Cell::Content Cell::getContent() const
{
return content;
}
void Cell::setContent(Content newContent)
{
content = newContent;
}