Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 10-02-2014, 03:42 PM
jdoran
Hill Giant
 
Join Date: Jul 2012
Posts: 212
Default

I've had some time to actually work on the code today, and have a couple of observations:

The parameter lists to routines like EventNPC are getting long, and the calls are not clear. For example:

Code:
parse->EventNPC(EVENT_HATE_LIST, owner->CastToNPC(), m, "0", 0);
The decision of whether the event should be associated with an NPC, player, item or spell is contained in the method call.

I wonder if it would be an improvement to have a central event handler which would make the calls to EventCommon based on a context object being passed in.

I was using a structure in my old code, but I think promoting it to a class might be worth it. I base this partly on observing that a lot of calls to the event system are using default parameters. Subclasses of this event context could have their own set of defaults.

If all of the parser calls to an event handler were replaced, there could be one central place where we could change event handling. If a new event is added which needs an extra value, the originator of the event could just call a new method to fill in this value and existing code wouldn't need to be changed.

The list of events is maintained in several locations. The parsers have their own id->string maps. Adding a new event type means updating several files.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:26 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3