Class: GuiInterface
- Defined in:
- lib/zombie-chaser/interface.rb
Instance Attribute Summary
Attributes inherited from Interface
Instance Method Summary collapse
- #finish_if_neccessary ⇒ Object
- #human=(human) ⇒ Object
-
#initialize ⇒ GuiInterface
constructor
A new instance of GuiInterface.
- #no_living_zombies_apart_from_me?(desired_step_count, actor) ⇒ Boolean
-
#something_happened ⇒ Object
Doesn’t need to be used, as window updates 60 times a second anyway.
- #zombie_list=(zombie_list) ⇒ Object
Methods inherited from Interface
Constructor Details
#initialize ⇒ GuiInterface
Returns a new instance of GuiInterface.
126 127 128 129 130 131 132 |
# File 'lib/zombie-chaser/interface.rb', line 126 def initialize @window = Window.new #Actor.window = @window #Fixme why can't this do the trick? Human.window = @window Zombie.window = @window @window_showing_thread = Thread.new {@window.show} end |
Instance Method Details
#finish_if_neccessary ⇒ Object
150 151 152 |
# File 'lib/zombie-chaser/interface.rb', line 150 def finish_if_neccessary @window_showing_thread.join end |
#human=(human) ⇒ Object
138 139 140 |
# File 'lib/zombie-chaser/interface.rb', line 138 def human=(human) @window.human = human end |
#no_living_zombies_apart_from_me?(desired_step_count, actor) ⇒ Boolean
146 147 148 |
# File 'lib/zombie-chaser/interface.rb', line 146 def no_living_zombies_apart_from_me?(desired_step_count, actor) @window.no_living_zombies_apart_from_me?(desired_step_count, actor) end |
#something_happened ⇒ Object
Doesn’t need to be used, as window updates 60 times a second anyway
135 136 |
# File 'lib/zombie-chaser/interface.rb', line 135 def something_happened end |
#zombie_list=(zombie_list) ⇒ Object
142 143 144 |
# File 'lib/zombie-chaser/interface.rb', line 142 def zombie_list=(zombie_list) @window.zombie_list = zombie_list end |