/
trilirium
/
Pacman
Обзор
Документация
Войти
/
trilirium
/
Pacman
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Task.cpp
57 строк
1 KB
Trilirium
first commit
19 июн 2026, 11:07
19 июн 2026, 11:07
d44591e
Код
Авторство
О чём код?
// Task.cpp // ///////////////////////////////////////////////////////////////////////////// #include <cassert> #include "ScheduledTasks.h" #include "Task.h" using namespace Puckman; // all possible tasks ScheduledTask * Task::tasks[10] = { }; ///////////////////////////////////////////////////////////////////////////// // initialization and cleanup ///////////////////////////////////////////////////////////////////////////// Task::Task(int taskId, TimeUnits units, int time) { id = taskId; timeUnits = units; remainingUnits = time; } Task::~Task() { } void Task::initScheduledTasksList() { tasks[0] = new IncrementPlayingSubstate(); tasks[1] = new IncrementCoinInsertedSubstate(); tasks[2] = new IncrementDemoSubstate(); tasks[3] = new IncrementGhostDeadSubstate(); tasks[4] = new ClearFruit(); tasks[5] = new ClearFruitPoints(); tasks[6] = new ClearReadyMessage(); tasks[7] = new IncrementCutscene1Substate(); tasks[8] = new IncrementCutscene2Substate(); tasks[9] = new IncrementCutscene3Substate(); } void Task::endScheduledTasksList() { for (int i = 0; i < 10; i++){ delete tasks[i]; } } // executes the task void Task::execute() { assert((id >= 0) && (id <= 9)); tasks[id]->execute(); }