Created
March 26, 2014 20:41
-
-
Save Skrylar/9792937 to your computer and use it in GitHub Desktop.
An example of my attempts at event map macros.
This file contains hidden or 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
type | |
CommandEvent = object | |
Actions = enum | |
AMeep, | |
APacake | |
MakeIntoEvent CommandEvent | |
when isMainModule: | |
var poopage: EventQueue | |
poopage.Init | |
var x = CommandEvent() | |
poopage.Enqueue AMeep, x | |
poopage.Enqueue APacake, x | |
HandleEvents(poopage): | |
# First form | |
On(CommandEvent, AMeep, debugEcho("Meep Command!")) | |
On(CommandEvent, APacake, debugEcho("Pancake Command!")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment