Multiple events or multiple if else statements?

Discussion in 'Plugin Development' started by rippin, Oct 14, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    rippin

    Is this the same or is there one that is better? I'm talking about the same event and if I have a lot of conditions it's easier to split it into another event method instead of having all the code messy in a single method.

    I'm just wondering if there is a difference and if one is better than another.
     
  2. single event, i can't see how multiple events could be better, i would assume it would cause more problems instead.
    you can also use switch/case functions instead of if/else
     
  3. Offline

    drtshock

    Unless you have to listen on different priorities you shouldn't listen to the same event twice. You can always pass parameters you need to different methods so you don't have too many nested statements.
     
    mollekake likes this.
Thread Status:
Not open for further replies.

Share This Page