Module: Scheduler

Defined in:
docs/0_Dependencies.rb,
docs/9_Loaded_Last.rb,
docs/4_Systems_003_Map_Engine.rb

Overview

The Sheduler also has a @storage Hash that is used by the tasks to store informations

Defined Under Namespace

Modules: EventTasks Classes: MessageTask, ProcTask

Class Method Summary collapse

Class Method Details

.__add_task(reason, klass, task)

add a task (and sort them by priority)

Parameters:

  • reason (Symbol)

    the reason

  • klass (Class, :any)

    the class of the scene

  • task (ProcTask, MessageTask)

    the task to run



173
174
# File 'docs/0_Dependencies.rb', line 173

def __add_task(reason, klass, task)
end

.__remove_task(reason, klass, name, priority)

Remove a task

Parameters:

  • reason (Symbol)

    the reason

  • klass (Class, :any)

    the class of the scene

  • name (String)

    the name that describe the task

  • priority (Integer)

    its priority



167
168
# File 'docs/0_Dependencies.rb', line 167

def __remove_task(reason, klass, name, priority)
end

.add_message(reason, klass, name, priority, object, *message)

Add a message task to the Scheduler

Parameters:

  • reason (Symbol)

    the reason

  • klass (Class, :any)

    the class of the scene

  • name (String)

    name that describe the task

  • priority (Integer)

    the priority of the task

  • object (Object)

    the object that receive the message

  • message (Array<Symbol, *args>)

    the message to send



228
229
# File 'docs/0_Dependencies.rb', line 228

def add_message(reason, klass, name, priority, object, *message)
end

.add_proc(reason, klass, name, priority, proc_object = nil, &block)

Add a proc task to the Scheduler

Parameters:

  • reason (Symbol)

    the reason

  • klass (Class)

    the class of the scene

  • name (String)

    the name that describe the task

  • priority (Integer)

    the priority of the task

  • proc_object (Proc) (defaults to: nil)

    the Proc object of the task (kept for compatibility should not be defined)

  • block (Proc)

    the Proc object of the task



200
201
# File 'docs/0_Dependencies.rb', line 200

def add_proc(reason, klass, name, priority, proc_object = nil, &block)
end

.get_boot_sceneObject

Return the object of the Boot Scene (usually Scene_Title)

Returns:



232
233
# File 'docs/0_Dependencies.rb', line 232

def get_boot_scene
end

.init

Initialize the Scheduler with no task and nothing in the storage



154
155
# File 'docs/0_Dependencies.rb', line 154

def init
end

.start(reason, klass = $scene.class)

Start tasks that are related to a specific reason

Parameters:

  • reason (Symbol)

    reason explained at the top of the page

  • klass (Class, :any) (defaults to: $scene.class)

    the class of the scene



160
161
# File 'docs/0_Dependencies.rb', line 160

def start(reason, klass = $scene.class)
end