[Component Entity System] Components design

Started by
10 comments, last by InferiorOlive 10 years, 3 months ago

Is Entity a Component?
i.e. can an Entity own an Entity as a member?

http://gamadu.com/artemis/javadoc/index.html

.
Component is an abstract, can only extend once. That's why it can not be used within itself.

Entity is a final class (same thing as saying a constant class if compared to C++).

Entity is also protected, which means it can not be used outside of it's derived class but can be used within a nested class (unlike String in the Java SE framework).

I'm still new at this but I'm going to guess the answer being no mainly because of three factors: 1) entity is final, 2) entity is not an interface, 3) is protected.

If I'm wrong, please explain as I am interested in learning why. Thanks.

Advertisement

Could you use a component to defer incoming messages to another entity, thereby establishing a parent-child entity relationship? Perhaps each hand could respond to incoming messages and then forward them to the head, which would then respond accordingly.

Example:

DamageMessage->hand.MessageHandler (hand doesn't have health component) -> ChildComponent -> ForwardMessageToParentEntity

the parent entity could handle the basic message (which is to take damage).

I don't know how others are making their component-entity systems, and I'm only using this strategy for the first time, so mine might be built quite differently than yours, and thus handle situations differently.

Just my thoughts.

Inspiration from my tea:

"Never wish life were easier. Wish that you were better" -Jim Rohn

soundcloud.com/herwrathmustbedragons

This topic is closed to new replies.

Advertisement