Created
June 25, 2012 16:28
-
-
Save zokier/2989586 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void (*yesno_cb)(bool); | |
void yn_tavern_room(bool b) | |
{ | |
if (b) | |
set_player_location(&loc_room_offline); | |
else | |
set_player_location(&loc_tavern_bartender); | |
} | |
void ac_tavern_room() | |
{ | |
yesno_cb = &yn_tavern_room; | |
print("Want a room"); | |
set_player_location(&loc_yesno); | |
} | |
void ac_yesno_yes() | |
{ | |
(*yesno_cb)(true); | |
} | |
void ac_yesno_no() | |
{ | |
(*yesno_cb)(false); | |
} | |
Location loc_yesno = { | |
"", /* NULL here would mean there be dragons. Always have "" instead */ | |
2, | |
{ | |
{ | |
'y', | |
"", | |
"Yes", | |
&ac_yesno_yes | |
}, | |
{ | |
'n', | |
"", | |
"No", | |
&ac_yesno_no | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment