EmergentOrganization / cell-rpg

:black_square_button: connect to a universe where cellular automata have run rampant
http://emergentorganization.github.io/bridge/
Other
12 stars 1 forks source link

Decouple Entity Components #79

Closed BrianErikson closed 8 years ago

BrianErikson commented 8 years ago

While refactoring #69, I've noticed that the entity components are heavily coupled to underlying logic, making it extremely hard to swap out logic. A fix for this would be to define generic Interfaces for each type of component, thus creating a contract for all future components:

7yl4r commented 8 years ago

IDisplayComponent seems straightforward enough, but physicsComp & moveComp seem different enough that I'm not sure what methods should be in ITransformComponent.

Also, that naming paradigm for interfaces is much better than ThisIsMyInterface... I'll have to update a few file names.

BrianErikson commented 8 years ago

Yeah I stole that naming convention from C# lol.

And I agree; to put both of those transform components under one umbrella, you would probably lose some functionality. The only way to keep it that generic is to deal with velocities -- we could still have setPosition() I guess, but it should come with a warning that it might mess with the physics engine

BrianErikson commented 8 years ago

Resolved with the addition of Artemis into the workflow