Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Objective.h
Go to the documentation of this file.
1/* Objective.h
2 Objective contains tasks
3*/
4#pragma once
5
6#include "Task.h"
7#include <vector>
8#include <memory>
9#include <string>
10#include <iostream>
11#include "system/system_utils.h"
12
14{
15public:
16 std::string title;
17 std::vector<std::unique_ptr<Task>> tasks;
18 Objective(const std::string& t = "Objective") : title(t) { SYSTEM_LOG << "Objective: " << title << " created\n"; }
19 ~Objective() { SYSTEM_LOG << "Objective: " << title << " destroyed\n"; }
20
21 void AddTask(std::unique_ptr<Task> task) { tasks.push_back(std::move(task)); }
22 bool IsComplete() const
23 {
24 for (const auto& t : tasks) if (!t->completed) return false;
25 return true;
26 }
27};
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
void AddTask(std::unique_ptr< Task > task)
Definition Objective.h:21
std::vector< std::unique_ptr< Task > > tasks
Definition Objective.h:17
Objective(const std::string &t="Objective")
Definition Objective.h:18
bool IsComplete() const
Definition Objective.h:22
std::string title
Definition Objective.h:16
#define SYSTEM_LOG