mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-17 05:22:35 +00:00
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:
21
lib/cyberarm_engine/ui/event.rb
Normal file
21
lib/cyberarm_engine/ui/event.rb
Normal 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
|
||||
Reference in New Issue
Block a user