Skip to content

Commit

Permalink
fix (./Scene): found a better way to get EntitySystem type
Browse files Browse the repository at this point in the history
  • Loading branch information
PharaEthan committed Jan 10, 2024
1 parent db0b9b5 commit 4c3f7dc
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 30 deletions.
24 changes: 12 additions & 12 deletions Assets/Scene/Menu.exodia
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Scene: Menu
Entities:
- Entity: 18114247486284332275
- Entity: 13929703132169399887
TransformComponent:
Translation: [0, 0, 15]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
TagComponent:
Tag: Camera
CameraComponent:
Camera:
ProjectionType: 0
Expand All @@ -12,27 +18,21 @@ Entities:
OrthographicFar: 1
Primary: true
FixedAspectRatio: false
TagComponent:
Tag: Camera
- Entity: 7839090563277919771
TransformComponent:
Translation: [0, 0, 15]
Translation: [0, 0, 0]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
- Entity: 6399166993246459951
TagComponent:
Tag: Pata-Pata
ScriptComponent:
Name: PataPata
RigidBody2DComponent:
BodyType: Dynamic
Velocity: [0, 0]
GravityScale: 1
Mass: 1
TagComponent:
Tag: Pata-Pata
TransformComponent:
Translation: [0, 0, 0]
Rotation: [0, 0, 0]
Scale: [1, 1, 1]
Prefabs:
[]
Systems:
- System: MovingSystem
- System: MovingSystem
4 changes: 0 additions & 4 deletions Examples/Entity-Component-System/src/FortniteEvent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ namespace Exodia {
// when unconfigure is called you usually want to unsubscribe from all events.
}

virtual std::string GetTypeOfSystem() const override {
return "FortniteZone";
}

private:
// Attributes
float _DamagePerSecond;
Expand Down
2 changes: 0 additions & 2 deletions Examples/Entity-Component-System/src/GravitySystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ namespace Exodia {
});
}

virtual std::string GetTypeOfSystem() const override { return "GravitySystem"; }

private:
// Attributes
float _GravityAmount;
Expand Down
4 changes: 3 additions & 1 deletion GameEngine/src/Exodia/Scene/Serializer/SceneSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ namespace Exodia {
out << YAML::Key << "Systems" << YAML::Value << YAML::BeginSeq;
{
for (auto &system : _Scene->_Systems) {
std::string typeName = extractTypeName(typeid(*system).name());

out << YAML::BeginMap;
out << YAML::Key << "System" << YAML::Value << system->GetTypeOfSystem();
out << YAML::Key << "System" << YAML::Value << typeName;
out << YAML::EndMap;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ namespace Exodia {

virtual void Receive(World *world, const Events::OnCollisionEntered &event) override;

virtual std::string GetTypeOfSystem() const override { return "CollisionSystem"; }

private:
bool CheckCollision(ComponentHandle<BoxCollider2DComponent> collider1,
ComponentHandle<TransformComponent> transform1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace Exodia {
/////////////
public:
virtual void Update(World *world, Timestep ts) override;
virtual std::string GetTypeOfSystem() const override { return "ParticleSystem"; }
};
}; // namespace Exodia

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace Exodia {
/////////////
public:
void Update(World *world, Timestep ts) override;
std::string GetTypeOfSystem() const override { return "GravitySystem"; }

private:
void ApplyGravity(ComponentHandle<RigidBody2DComponent> rigidBody, Timestep ts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace Exodia {
/////////////
public:
virtual void Update(World *world, Timestep ts) override;
virtual std::string GetTypeOfSystem() const override { return "MovingSystem"; }

private:
void ApplyVelocity(ComponentHandle<RigidBody2DComponent> rigidBody,
Expand Down
1 change: 0 additions & 1 deletion GameEngine/src/Exodia/Scene/System/Script/ScriptSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace Exodia {
/////////////
public:
virtual void Update(World *world, Timestep ts) override;
virtual std::string GetTypeOfSystem() const override { return "ScriptSystem"; }
};
}; // namespace Exodia

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ namespace Exodia {
virtual void Unconfigure(UNUSED(World *world)){};

virtual void Update(UNUSED(World *world), UNUSED(Timestep ts)){};

virtual std::string GetTypeOfSystem() const = 0;
};
}; // namespace Exodia

Expand Down
1 change: 0 additions & 1 deletion R-Type/src/System/AnimationSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace RType {
public:
void Update(Exodia::World *world, Exodia::Timestep ts) override;
void Receive(Exodia::World *world, const Events::AnimationEndingEvent &event) override;
std::string GetTypeOfSystem() const override { return "AnimationSystem"; }
};
}; // namespace RType

Expand Down
1 change: 0 additions & 1 deletion SandBox/Ethan/R-Type/src/Systems/AnimationSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace RType {
public:
void Update(Exodia::World *world, Exodia::Timestep ts) override;
void Receive(Exodia::World *world, const Events::AnimationEndingEvent &event) override;
std::string GetTypeOfSystem() const override { return "AnimationSystem"; }
};
}; // namespace RType

Expand Down
1 change: 0 additions & 1 deletion SandBox/Ethan/R-Type/src/Systems/FadeSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ namespace RType {
/////////////
public:
void Update(Exodia::World *world, Exodia::Timestep ts) override;
std::string GetTypeOfSystem() const override { return "FadeSystem"; }
};
}; // namespace RType

Expand Down

0 comments on commit 4c3f7dc

Please sign in to comment.