25 lines
479 B
C++
25 lines
479 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <memory>
|
|
#include <yaml-cpp/yaml.h>
|
|
|
|
class Object;
|
|
|
|
class Component {
|
|
public:
|
|
Component(Object* owner) : owner(owner) {}
|
|
virtual ~Component() = default;
|
|
|
|
Object* GetOwner() const { return owner; }
|
|
void SetOwner(Object* o) { owner = o; }
|
|
|
|
virtual std::string GetName() const = 0;
|
|
|
|
virtual void Save(YAML::Emitter& out) const = 0;
|
|
virtual void Load(const YAML::Node& node) = 0;
|
|
|
|
protected:
|
|
Object* owner;
|
|
};
|