#include #include #include "game.h" #include "flag.h" #include "predicate.h" bool predicate_fulfilled(Game *g, Predicate *p) { switch (p->type) { case PREDICATE_TRUE: return true; case PREDICATE_IN_ROOM: return strcmp(g->current_room->name, p->argument) == 0; case PREDICATE_FLAG_ENABLED: return flag_value(g->flags, p->argument) > 0; default: printf("Invalid predicate type\n"); return false; } }