commit game_get_state / game_get_flags

This commit is contained in:
Nathan Nunes committed 2021-12-01 17:28:30 +01:00
1 parent 53304abf58
commit 58abef31ec
2 files changed
+20 -4

No files matched your search

+18 -2
View File
@@ -81,11 +81,27 @@ square game_get_square(cgame g, uint i, uint j) {
}
square game_get_state(cgame g, uint i, uint j) {
return 0;
if(g->tab_cell[i][j] >= F_ERROR) {
g->tab_cell[i][j] -= F_ERROR;
}
if(g->tab_cell[i][j] >= F_LIGHTED) {
g->tab_cell[i][j] -= F_LIGHTED;
}
return g->tab_cell[i][j];
}
square game_get_flags(cgame g, uint i, uint j) {
return 0;
if (g->tab_cell[i][j] >= F_ERROR) {
g->tab_cell[i][j] -= F_ERROR;
if (g->tab_cell[i][j] >= F_LIGHTED) {
return (F_ERROR|F_LIGHTED);
}
return (F_ERROR);
}
if (g->tab_cell[i][j] >= F_LIGHTED) {
return (F_LIGHTED);
}
return (S_BLANK);
}
bool game_is_blank(cgame g, uint i, uint j) {