Refactored Container to be an Element, removed button_up/button_down passing to elements, moved Gui out of GameState and into GuiState, added scaffolding for events (Publish/Subscribe pattern). Element input is broken ATM.

This commit is contained in:
2019-03-01 09:41:51 -06:00
parent 04ec6682ee
commit 18ff0a1ea9
15 changed files with 258 additions and 234 deletions

View File

@@ -0,0 +1,21 @@
module CyberarmEngine
module Event
def subscribe(event, method = nil, &block)
end
def unsubscribe(event)
end
def publish(event, *args)
# block.call(*args)
end
def event(event)
@event_handler ||= Hash.new
@event_handler[event] ||= []
end
end
class Subscription
end
end