ThreeLab/Engine/Components/Component.h

20 lines
431 B
C
Raw Normal View History

2025-04-01 16:53:23 +00:00
#ifndef COMPONENT_H
#define COMPONENT_H
2025-04-02 00:19:53 +00:00
#include <yaml-cpp/yaml.h>
2025-04-01 16:53:23 +00:00
class Component {
public:
virtual ~Component() {}
2025-04-02 00:19:53 +00:00
2025-04-01 16:53:23 +00:00
// Update the component each frame.
virtual void Update(float deltaTime) = 0;
2025-04-02 00:19:53 +00:00
// Save the component's state to a YAML node.
virtual YAML::Node Save() const = 0;
// Load the component's state from a YAML node.
virtual void Load(const YAML::Node &node) = 0;
2025-04-01 16:53:23 +00:00
};
#endif // COMPONENT_H