Cuberite Forum
Entity Effects - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Entity Effects (/thread-1294.html)



Entity Effects - NiLSPACE - 01-01-2014

Does anyone have an idea on how to manage entity effects?
I was thinking:
  • Each effects gets it's own class. The class contains:
    • The entity it has to tick.
    • The level of the effect. (Poison 1/Poison 4)
  • Each entity has an array with the effects it has.
  • Each tick the entity calls a Tick function that manages what should happen.



RE: Entity Effects - xoft - 01-01-2014

How many effects are there? Won't that be unreasonably many miniature classes, when they could all be handled by a single function with a medium-sized switch()?


RE: Entity Effects - SamJBarney - 01-01-2014

True, but where do we stick it in the new AI rebuild?