Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBrentChua

Posted 27 October 2012 - 12:26 AM

Strictly speaking, no. You would ask yourself how do these systems communicate if none of them know of each other. The (hidden) solution for this to make this work is to actually build another layer that manages the communication between these systems. This is where the event system/manager comes in. The event system is pretty much just a messenger that sends messages to the particular addressee. Or sends the message to those who are only interested in that particular type of message. This way, your model, view and controller doesn't have to know about any of them. They just care about sending all their information to the event system and the event system takes care of sending these info to the other systems interested.

Searching "event system" in google would return three or four links about this subject.

You can check out my simple implementation of an event system here:
http://pulsetec.code...ew/15801#463060
http://pulsetec.code...ew/15801#463062

btw, a more appropriate name for this system is called a listener/dispatcher design pattern.

This is just my suggestion but it might be better for you to use components instead of trying to follow MVC for your game objects. I don't know about the others but from my experience MVC is more used/implemented in defining their high-level applications. Unity for example might use something similar to MVC for the editor and main game systems but their GameObject uses a component object model.

#1BrentChua

Posted 27 October 2012 - 12:20 AM

Strictly speaking, no. You would ask yourself how do these systems communicate if none of them know of each other. The (hidden) solution for this to make this work is to actually build another layer that manages the communication between these systems. This is where the event system/manager comes in. The event system is pretty much just a messenger that sends messages to the particular addressee. Or sends the message to those who are only interested in that particular type of message.

Searching "event system" in google would return three or four links about this subject.

You can check out my simple implementation of an event system here:
http://pulsetec.codeplex.com/SourceControl/changeset/view/15801#463060
http://pulsetec.codeplex.com/SourceControl/changeset/view/15801#463062

btw, a more appropriate name for this system is called a listener/dispatcher design pattern.

This is just my suggestion but it might be better for you to use components instead of trying to follow MVC for your game objects. I don't know about the others but from my experience MVC is more used/implemented in defining their high-level applications. Unity for example might use something similar to MVC for the editor and main game systems but their GameObject uses a component object model.

PARTNERS