Entropy icon indicating copy to clipboard operation
Entropy copied to clipboard

Add a base event to handle multiple events at once + two new events making use of it

Open bl4ckscor3 opened this issue 2 years ago • 1 comments

This pull request adds a new abstract event AbstractMultiEvent as well as two new events TwoAtOnceEvent and FiveAtOnceEvent that make use of it - they run two/five events at the same time respectively. AbstractMultiEvent is useful for handling multiple events at once. Subclasses can select events they want to run, and AbstractMultiEvent handles the rest. The events get rendered as a group in the queue as well. I have at least two more events planned that can make use of this. Here's a showcase of how it looks:

This PR is a draft because there are still some issues with this, but I still wanted to gather some feedback on this idea as well as perhaps get help with fixing these issues. I currently know of:

  • Having very few events active including both of the new onces leads to a StackOverflowException when activating one of the new events (tested with only the two new events, as well as the new ones + another one for a total of 3)
  • Sometimes with just a few events enabled that include the new events, the queue will be incorrect (Note the first group of elements has 6 instead of 5. Timers are not working because I am in spectator mode). (tested with the two new events + 3 others for a total of 5)

bl4ckscor3 avatar Mar 21 '23 11:03 bl4ckscor3

I think I have ironed out the two problems I explained in my opening post. The NothingEvent came into good use as a technical help! I am still leaving this as a draft for now incase any more issues pop up or more feedback is received.

bl4ckscor3 avatar Apr 02 '23 22:04 bl4ckscor3