Module: Chingu::GameStateHelpers

Included in:
GameState, Window
Defined in:
lib/chingu/helpers.rb

Overview

push_game_state accepts either a class inherited from GameState or an object-instance from such a class.

It will make call new() on a class, and just push an object.

Instance Method Summary collapse

Instance Method Details

#clear_game_statesObject



139
140
141
# File 'lib/chingu/helpers.rb', line 139

def clear_game_states
  $window.game_state_manager.clear_game_states
end

#current_game_stateObject



131
132
133
# File 'lib/chingu/helpers.rb', line 131

def current_game_state
  $window.game_state_manager.current_game_state
end

#pop_game_state(options = {}) ⇒ Object



119
120
121
# File 'lib/chingu/helpers.rb', line 119

def pop_game_state(options = {})
  $window.game_state_manager.pop_game_state(options)
end

#previous_game_stateObject



135
136
137
# File 'lib/chingu/helpers.rb', line 135

def previous_game_state
  $window.game_state_manager.previous_game_state
end

#push_game_state(state, options = {}) ⇒ Object



115
116
117
# File 'lib/chingu/helpers.rb', line 115

def push_game_state(state, options = {})
  $window.game_state_manager.push_game_state(state, options)      
end

#switch_game_state(state, options = {}) ⇒ Object



123
124
125
# File 'lib/chingu/helpers.rb', line 123

def switch_game_state(state, options = {})
  $window.game_state_manager.switch_game_state(state, options)
end

#transitional_game_state(state, options = {}) ⇒ Object



127
128
129
# File 'lib/chingu/helpers.rb', line 127

def transitional_game_state(state, options = {})
  $window.game_state_manager.transitional_game_state(state, options)      
end