From 5eed818cc3bd22ed1458d139bd612533c4fc58c1 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Sat, 25 Jan 2020 15:51:06 +0400 Subject: [PATCH] It makes more sense for Component to be an interface --- core/src/com/me/asteroids/components/AccelerationComponent.java | 2 +- core/src/com/me/asteroids/components/ModelComponent.java | 2 +- core/src/com/me/asteroids/components/PlayerComponent.java | 2 +- core/src/com/me/asteroids/components/PositionComponent.java | 2 +- core/src/com/me/asteroids/components/VelocityComponent.java | 2 +- core/src/com/me/common/ecs/Component.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/com/me/asteroids/components/AccelerationComponent.java b/core/src/com/me/asteroids/components/AccelerationComponent.java index ff84783..1c44571 100644 --- a/core/src/com/me/asteroids/components/AccelerationComponent.java +++ b/core/src/com/me/asteroids/components/AccelerationComponent.java @@ -3,7 +3,7 @@ package com.me.asteroids.components; import com.badlogic.gdx.math.Vector2; import com.me.common.ecs.Component; -public class AccelerationComponent extends Component { +public class AccelerationComponent implements Component { public Vector2 acceleration; diff --git a/core/src/com/me/asteroids/components/ModelComponent.java b/core/src/com/me/asteroids/components/ModelComponent.java index f7408dd..c4cba0e 100644 --- a/core/src/com/me/asteroids/components/ModelComponent.java +++ b/core/src/com/me/asteroids/components/ModelComponent.java @@ -4,7 +4,7 @@ import com.badlogic.gdx.math.Polygon; import com.badlogic.gdx.math.Rectangle; import com.me.common.ecs.Component; -public class ModelComponent extends Component { +public class ModelComponent implements Component { public Polygon model; public Rectangle aabb; diff --git a/core/src/com/me/asteroids/components/PlayerComponent.java b/core/src/com/me/asteroids/components/PlayerComponent.java index 6d1ee62..708db85 100644 --- a/core/src/com/me/asteroids/components/PlayerComponent.java +++ b/core/src/com/me/asteroids/components/PlayerComponent.java @@ -2,6 +2,6 @@ package com.me.asteroids.components; import com.me.common.ecs.Component; -public class PlayerComponent extends Component { +public class PlayerComponent implements Component { // TODO: implement engine feature for tagging entities (as player, for e.g.) } diff --git a/core/src/com/me/asteroids/components/PositionComponent.java b/core/src/com/me/asteroids/components/PositionComponent.java index c708848..25e4cbc 100644 --- a/core/src/com/me/asteroids/components/PositionComponent.java +++ b/core/src/com/me/asteroids/components/PositionComponent.java @@ -3,7 +3,7 @@ package com.me.asteroids.components; import com.badlogic.gdx.math.Vector2; import com.me.common.ecs.Component; -public class PositionComponent extends Component { +public class PositionComponent implements Component { public Vector2 position; public float rotation; diff --git a/core/src/com/me/asteroids/components/VelocityComponent.java b/core/src/com/me/asteroids/components/VelocityComponent.java index 17b5a77..2754c96 100644 --- a/core/src/com/me/asteroids/components/VelocityComponent.java +++ b/core/src/com/me/asteroids/components/VelocityComponent.java @@ -3,7 +3,7 @@ package com.me.asteroids.components; import com.badlogic.gdx.math.Vector2; import com.me.common.ecs.Component; -public class VelocityComponent extends Component { +public class VelocityComponent implements Component { public Vector2 velocity; public float maxVelocity; diff --git a/core/src/com/me/common/ecs/Component.java b/core/src/com/me/common/ecs/Component.java index ce66296..9698727 100644 --- a/core/src/com/me/common/ecs/Component.java +++ b/core/src/com/me/common/ecs/Component.java @@ -1,5 +1,5 @@ package com.me.common.ecs; -public abstract class Component { +public interface Component { }