ScummVM API documentation
MutationOfJB::TaskManager Class Reference

#include <taskmanager.h>

Public Member Functions

 TaskManager (Game &game)
 
void startTask (const TaskPtr &task)
 
void stopTask (const TaskPtr &task)
 
TaskPtr getTask (Task *task)
 
void update ()
 
GamegetGame ()
 

Detailed Description

Handles task management.

Tasks are a way run game logic asynchronously.

Member Function Documentation

◆ startTask()

void MutationOfJB::TaskManager::startTask ( const TaskPtr task)

Adds the task to the internal list and starts it.

When the task is finished, it is automatically removed from the list. stopTask does not need to be called for that.

◆ stopTask()

void MutationOfJB::TaskManager::stopTask ( const TaskPtr task)

Stops the task and removes it from the internal list.

Call this only if you need to explicitly stop the task (usually before it's finished).

◆ getTask()

TaskPtr MutationOfJB::TaskManager::getTask ( Task task)

Gets task shared pointer from raw pointer.

Since task lifetime is under control of SharedPtr, raw pointers shouldn't be used. However, if only a raw pointer is available (e.g. this), the method can be used to obtain a SharedPtr.


The documentation for this class was generated from the following file: