diff options
Diffstat (limited to 'src/libsok/sok-ctx.c')
-rw-r--r-- | src/libsok/sok-ctx.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/libsok/sok-ctx.c b/src/libsok/sok-ctx.c index ec36d2a..84fe8ed 100644 --- a/src/libsok/sok-ctx.c +++ b/src/libsok/sok-ctx.c @@ -547,6 +547,10 @@ bool sok_ctx_walk( } } + if (cbs->on_walls_start && !cbs->on_walls_start(ctx, data)) { + return false; + } + if (cbs->on_wall) { // walk walls for (size_t i = 0; i < (ctx->level.size.x * ctx->level.size.y); i++) { @@ -564,6 +568,14 @@ bool sok_ctx_walk( } } + if (cbs->on_walls_end && !cbs->on_walls_end(ctx, data)) { + return false; + } + + if (cbs->on_goals_start && !cbs->on_goals_start(ctx, data)) { + return false; + } + if (cbs->on_goal) { // walk goals for (size_t i = 0; i < ctx->level.num_goals; i++) { @@ -577,6 +589,14 @@ bool sok_ctx_walk( } } + if (cbs->on_goals_end && !cbs->on_goals_end(ctx, data)) { + return false; + } + + if (cbs->on_boxes_start && !cbs->on_boxes_start(ctx, data)) { + return false; + } + if (cbs->on_box) { // walk boxes for (size_t i = 0; i < ctx->level.num_boxes; i++) { @@ -589,6 +609,14 @@ bool sok_ctx_walk( } } + if (cbs->on_boxes_end && !cbs->on_boxes_end(ctx, data)) { + return false; + } + + if (cbs->on_moves_start && !cbs->on_moves_start(ctx, data)) { + return false; + } + if (cbs->on_move) { // walk moves for (size_t i = 0; i < ctx->num_moves; i++) { @@ -599,6 +627,10 @@ bool sok_ctx_walk( } } + if (cbs->on_moves_end && !cbs->on_moves_end(ctx, data)) { + return false; + } + // return success return true; } |