diff options
author | daniel-Jones <daniel@danieljon.es> | 2018-09-02 15:02:05 +0930 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2018-09-02 15:02:05 +0930 |
commit | fed9330a4a98906648306e7524882feac80980e4 (patch) | |
tree | 7d30af29b1a8a4fbe2fe34d8dffca4f9fc4445f5 /square.cpp | |
parent | 12f885b28b9740349dcee6a7c57d7b774017fd05 (diff) | |
download | qtminesweeper-fed9330a4a98906648306e7524882feac80980e4.tar.gz qtminesweeper-fed9330a4a98906648306e7524882feac80980e4.zip |
added constants files, moved around some classes, beginning of drawing functions etc
Diffstat (limited to 'square.cpp')
-rw-r--r-- | square.cpp | 41 |
1 files changed, 12 insertions, 29 deletions
@@ -20,24 +20,15 @@ square::square() { } -void square::setrealx(int x) -{ - realx = x; -} - -void square::setrealy(int y) -{ - realy = y; -} -void square::setgridx(int x) +int square::getgridx() { - gridx = x; + return gridx; } -void square::setgridy(int y) +int square::getgridy() { - gridy = y; + return gridy; } int square::getrealx() @@ -49,26 +40,18 @@ int square::getrealy() { return realy; } - -int square::getgridx() -{ - return gridx; -} - -int square::getgridy() -{ - return gridy; -} - void square::movetorealpos(int x, int y) { - setrealx(x); - setrealy(y); + realx = x; + realy = y; } void square::movetogridpos(int x, int y) { - setgridx(x); - setgridy(y); - + gridx = x; + gridy = y; + int rx, ry; + rx = x * SQUARESIZE + BORDEROFFSET; + ry = y * SQUARESIZE + BORDEROFFSET; + movetorealpos(rx, ry); } |