aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Metadata.h
blob: fdbed4183b3cbbad32c57cab3424a5986b15ab53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once

#include <string>
#include <vector>

#include "../Component.h"

namespace crepe {

/**
 * \brief Metadata component
 * 
 * This class represents the Metadata component. It stores the name, tag, parent
 * and children of a GameObject.
 */
class Metadata : public Component {
public:
	/**
	 * \param game_object_id The id of the GameObject this component belongs to
	 * \param name The name of the GameObject
	 * \param tag The tag of the GameObject
	 */
	Metadata(uint32_t game_object_id, const std::string & name,
			 const std::string & tag);
	/**
	 * \brief Get the maximum number of instances for this component
	 *
	 * \return The maximum number of instances for this component
	 */
	virtual int get_instances_max() const { return 1; }

public:
	//! The name of the GameObject
	const std::string NAME;
	//! The tag of the GameObject
	const std::string TAG;
	//! The id of the parent GameObject (-1 if no parent)
	uint32_t parent = -1;
	//! The ids of the children GameObjects
	std::vector<uint32_t> children;
};

} // namespace crepe