Skip to main content
deleted 13 characters in body
Source Link
Robert Rouhani
  • 2.3k
  • 16
  • 17

Entity-Component systems are different from MVC systems. Specifically in this case, an Entity-Component system is not a type of MVC system.

There are a broad range of component-based entity systems, each of them handling this a bit differently, but the way I decouple drawing from data is to use Systems. A system is a class that takes data from components and works with them as a group. Some examples of systems would be a CollisionDetectionSystem or an AnimationSystem or, being the point of this question, a GraphicsSystem. The GraphicsSystem would be registered with each component, and they could pass in their data to the system.

This pattern lets you decouple most, if not all logic from components (including rendering). There are definitely other ways of doing it, but I've found this one to be the most straightforward.

Entity-Component systems are different from MVC systems. Specifically in this case, an Entity-Component system is not a type of MVC system.

There are a broad range of component-based entity systems, each of them handling this a bit differently, but the way I decouple drawing from data is to use Systems. A system is a class that takes data from components and works with them as a group. Some examples of systems would be a CollisionDetectionSystem or an AnimationSystem or, being the point of this question, a GraphicsSystem. The GraphicsSystem would be registered with each component, and they could pass in their data to the system.

This pattern lets you decouple most, if not all logic from components (including rendering). There are definitely other ways of doing it, but I've found this one to be the most straightforward.

Entity-Component systems are different from MVC systems. Specifically, an Entity-Component system is not a type of MVC system.

There are a broad range of component-based entity systems, each of them handling this a bit differently, but the way I decouple drawing from data is to use Systems. A system is a class that takes data from components and works with them as a group. Some examples of systems would be a CollisionDetectionSystem or an AnimationSystem or, being the point of this question, a GraphicsSystem. The GraphicsSystem would be registered with each component, and they could pass in their data to the system.

This pattern lets you decouple most, if not all logic from components (including rendering). There are definitely other ways of doing it, but I've found this one to be the most straightforward.

Source Link
Robert Rouhani
  • 2.3k
  • 16
  • 17

Entity-Component systems are different from MVC systems. Specifically in this case, an Entity-Component system is not a type of MVC system.

There are a broad range of component-based entity systems, each of them handling this a bit differently, but the way I decouple drawing from data is to use Systems. A system is a class that takes data from components and works with them as a group. Some examples of systems would be a CollisionDetectionSystem or an AnimationSystem or, being the point of this question, a GraphicsSystem. The GraphicsSystem would be registered with each component, and they could pass in their data to the system.

This pattern lets you decouple most, if not all logic from components (including rendering). There are definitely other ways of doing it, but I've found this one to be the most straightforward.