MessageRouter and EntityManager

Hi all.

I am working on FuzzyStateMachine when I noticed that the EntityManager and the MessageRouter can become one class.



So the messageRouter would go under EntityManager and you would send messages in a static way via the EntityManager.



Any thoughts regarding this?



DP


the messageRouter would go under EntityManager



For clarification.. what do you mean by that?

Also not sure what you mean by 'a static way'.. Do you mean using static methods, or using things in an unchanging way (like.. the non-Java meaning of 'static' :) )?

Sorry.. I guess I don't really follow anything other than you intend on combining the two classes. :D


--K

my fault. Bad english.



What I meant was that the MessageRouter would be combined with EntityManager and the new combined class given the name EntityManager.



by a static way i mean that the methods will be static so that any class can obtain the required entity or pass on a message to another entity.



Having said that, I do feel that both classes do different things and should not be made as one. However, it makes sense to put them together as if you send a message to an entity, you expect to obtain that entity from the same place that you sent the message to. (Possible bad english again!)



Hope that makes it clearer.



DP

I think that it is a good idea. It would make it much simpler to use (One less class to think about).

right. Both classes have been removed and have been replaced by:



com.jme.ai.AISystem



AISystem does all the EntityManager and MessageRouter jobs. It also updates the rootEntityNode, so you dont have to.



a new zip is up at:



http://www.myjavaserver.com/~digiwired/ai-code.zip



Thx, DP