Will it be appropriate for Entity classes to be an instanceof AppState?

I’m curious here to see if it would be appropriate for Entities to be an instanceof AppState. I personally don’t see a problem, but I’m curious if this is/n’t good practice.

By looking at the JavaDocs of AppState:

AppState represents continously executing code inside the main loop.

Once again, I’m just asking if it’s good practice for an Entity to be an instanceof AppState.

AppStates are global… seems strange to have an entity be a subclass of AppState.

AppState is meant to extend the functionality of the application. App states have a lot of stuff that an entity won’t need… probably more likely that you have an app state that manages a whole bunch of entities.

So, in a word: no… it’s not really appropriate.

1 Like

Well your quote answers itself.
A entity (and its components) never ever should execute anything.
Thats what the systems are for.
That is if you mean EntityComponentSystem entities.
If you mean like hibernate/jpa entities thats a different topic.

btw how did you manage to post outside of any topic? According to the latest view this post is topicless O.o

I think the forum is busted. At least, I had one post I tried to put into a topic and it never went and no matter how many times I set it, it wouldn’t go.

…either that or we still let people post without selecting one.

But wouldn’t an entity be an instanceof a Control? You can attach it to a spatial and get it whenever you need.

You only dont need the update Calls and such.

Only if you are mixing visualization and game objects together… not great to start that way if you can avoid it.

Still then, a controll usually executes some code, and is not just a data storage.

also you will get great headaches for stuff like a vehicle where you suddenly have physicstuff and multiple spatials to process.