Module: Scheduler

Defined in:
docs/00700_Ajout_PSDK.rb,
docs/99999_Scripts_a_haute_dependences.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



246
247
# File 'docs/00700_Ajout_PSDK.rb', line 246

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



240
241
# File 'docs/00700_Ajout_PSDK.rb', line 240

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



301
302
# File 'docs/00700_Ajout_PSDK.rb', line 301

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



273
274
# File 'docs/00700_Ajout_PSDK.rb', line 273

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:



305
306
# File 'docs/00700_Ajout_PSDK.rb', line 305

def get_boot_scene
end

.init

Initialize the Scheduler with no task and nothing in the storage



227
228
# File 'docs/00700_Ajout_PSDK.rb', line 227

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



233
234
# File 'docs/00700_Ajout_PSDK.rb', line 233

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