aboutsummaryrefslogtreecommitdiff
path: root/src/board.c
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-04-01 00:55:44 +0300
committereug-vs <eugene@eug-vs.xyz>2022-04-01 01:08:30 +0300
commit87877154fa2386dc99aa21389144aa2debec656a (patch)
tree6bb0bc38c340a472f707beeeb96d896672481e1e /src/board.c
parentf9da494260fb1b876378bdc3eadd7bc15aec0221 (diff)
downloadcarcassonne-engine-c-87877154fa2386dc99aa21389144aa2debec656a.tar.gz
feat: indicate allowed placements with color
Diffstat (limited to 'src/board.c')
-rw-r--r--src/board.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/board.c b/src/board.c
index 056156c..a09b45c 100644
--- a/src/board.c
+++ b/src/board.c
@@ -30,15 +30,8 @@ int is_allowed_placement(Tile tile, int index, BoardUnit* board) {
}
int place_tile(Tile tile, int index, BoardUnit* board, int force) {
- if (!is_center_index(index)) {
- printf("Not a valid tile index: %i\n", index);
- return 0;
- }
-
- if (!force && !is_allowed_placement(tile, index, board)) {
- printf("Can not place tile %s (%c)\n", tile.edges, tile.center);
- return 0;
- }
+ if (!is_center_index(index)) return 0;
+ if (!force && !is_allowed_placement(tile, index, board)) return 0;
board[index].feature = tile.center;
for (int i = 0; i < 4; i++) {