module FelECS::Stage

Stores Scenes you add to it which you want to execute on each frame. When called upon will execute all Systems in the Scenes in the Stage and will execute them according to their priority order.

Attributes

scenes[W]

Allows clearing of scenes and systems. Used internally by FelECS and shouldn’t need to be ever used by developers @!visibility private

Public Class Methods

add(*scenes_to_add) click to toggle source

Add any number of Scenes to the Stage @return [Boolean] true

# File lib/felecs/stage_manager.rb, line 13
def add(*scenes_to_add)
  self.scenes |= scenes_to_add
  self.scenes = scenes.sort_by(&:priority)
  true
end
call() click to toggle source

Executes one frame of the game. This executes all the Scenes added to the Stage in order of their priority. @return [Boolean] true

# File lib/felecs/stage_manager.rb, line 35
def call
  self.scenes.each(&:call)
  true
end
clear() click to toggle source

Clears all Scenes that were added to the Stage @return [Boolean] true

# File lib/felecs/stage_manager.rb, line 28
def clear
  self.scenes.clear
  true
end
remove(*scenes_to_remove) click to toggle source

Remove any number of Scenes from the Stage @return [Boolean] true

# File lib/felecs/stage_manager.rb, line 21
def remove(*scenes_to_remove)
  self.scenes -= scenes_to_remove
  true
end
scenes() click to toggle source

Contains all the Scenes added to the Stage @return [Array<Scene>]

# File lib/felecs/stage_manager.rb, line 42
def scenes
  @scenes ||= []
end