Cuberite Forum

Full Version: Entity Effects
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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()?
True, but where do we stick it in the new AI rebuild?