<!-- MHonArc v2.4.4 --> <!--X-Subject: DBs and Events --> <!--X-From-R13: f001tzhNabin.jevtug.rqh --> <!--X-Date: Wed, 11 Feb 1998 14:26:09 +0000 --> <!--X-Message-Id: Pine.PMDF.3.95.980211090921.543348537A-100000#nova,wright.edu --> <!--X-Content-Type: text/plain --> <!--X-Reference: Pine.LNX.3.91.980210211015.65K-100000@uni-corn.demon.co.uk --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, DBs and Events</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:s001gmu#nova,wright.edu"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00399.html">Previous</a> | <a href="msg00401.html">Next</a> ] Thread: [ <a href="msg00399.html">Previous</a> | <a href="msg00432.html">Next</a> ] Index: [ <A HREF="author.html#00400">Author</A> | <A HREF="#00400">Date</A> | <A HREF="thread.html#00400">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>DBs and Events</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI> <LI><em>Subject</em>: DBs and Events</LI> <LI><em>From</em>: <A HREF="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</A></LI> <LI><em>Date</em>: Wed, 11 Feb 1998 09:26:16 -0500 (EST)</LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> On Wed, 11 Feb 1998, Greg Munt wrote: > On Tue, 10 Feb 1998, Nathan Yospe wrote: > > > On Tue, 10 Feb 1998, Greg Munt wrote: [caching etc...] > > :Any references to Event Management? Is there any alternative to using a > > :pointer to a function, to store the Event->function()? (This has the > > :disadvantage of every Event->function() needing to have the same number > > :and type of parameters being passed to it.) > > > > Here we go. This I can help you with. Events don't have to be functions, > > for a start. An event could be stored as anything, from a script on down > > to a held thread. I store mine as classes... any action is executed from > > an event class, which grabs the nearest available execution thread, sets > > it to the event's references, and frees it to go. Events are, by design, > > only actually capable of grabbing one specific thread, such that any set > > of events cannot execute asynchronously on the same resources. Functions > > are actually pulled up _after_ execution begins... Event.Process() is at > > its basis a normalization check, which tries to match a list of objects, > > and upon success, changes the values of the objects to a new norm, then, > > with its still-active thread, allows those objects to update. The object > > update methods are the actual functions involved, and once each object's > > updates are complete (and affected objects with zero delay complete such > > updates as the modified objects have made available) the thread is wiped > > clear of variables, set to sleep, and returned to the pool. > > I'm not sure I understand this too well. Are you suggesting this? > > class Event > { > private: > DataType1 *a; > DataType2 *b; > ... > > public: > ... > process(); > }; I don't do things exactly the same way as Nathan, but my approach is pretty similar. Events work pretty well when done as Classes, I think. > I still can't see how the event isn't a function. The tasks that the > event does have to be stored in a function? well, when you get down to it, what the event does HAS to be in a function somewhere. What he was saying (I believe), is that you don't necessarily have to have a struct with a function pointer in it, limiting the type of functions that can be assigned. Classes are not really much different, but because of data encapsulation it's a lot cleaner to get around the limit on the # of paramaters to the event handling function. > Am I wrong in thinking that the data that an Event needs (eg pointer to a > Player) are stored in the class, with a function - which takes no > parameters - calling class methods to do whatever it is that the Event is > trying to achieve? Also, it looks like Event would need to be a template. > Forget that, am using Linux g++ :( you are correct in assuming that all relevent data should be stored in the event class. You are incorrect in assuming that the event class has to be a template class. I suppose you could do it that way, but I think it'd be a lot cleaner if you just descend a bunch of event sub-classes from the base event class. Each sub-class would have a different set of variables, and it's own version of the event.process() method. The event driver only need know about a very limited subset (if not just one) of the event classes. what's wrong with linux g++, as far as templates go, btw? haven't had a need for a template class yet, but then I'm not very far into things. :) > I'm free of Cobol now! Hurrah! heh. I've never touched COBOL, and if I can help it, I never will. :) -Greg </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <ul compact><li><strong>Follow-Ups</strong>: <ul> <li><strong><A NAME="00432" HREF="msg00432.html">OT: Linux g++</A></strong> <ul compact><li><em>From:</em> Greg Munt <greg#uni-corn,demon.co.uk></li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="00399" HREF="msg00399.html">Re: [MUD-Dev] DBs and Events</A></STRONG> <UL><LI><EM>From:</EM> Greg Munt <greg#uni-corn,demon.co.uk></LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00399.html">Re: [MUD-Dev] DBs and Events</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00401.html">META: Unsubscribed users dur to bounces</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00399.html">Re: [MUD-Dev] DBs and Events</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00432.html">OT: Linux g++</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00400"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00400"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><STRONG>No Subject</STRONG>, <EM>(continued)</EM> <ul compact> <LI><strong><A NAME="00905" HREF="msg00905.html">No Subject</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 26 Mar 1998, 17:32 GMT </LI> </ul> </LI> <LI><strong><A NAME="00396" HREF="msg00396.html">DBs and Events</A></strong>, Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Tue 10 Feb 1998, 18:30 GMT <UL> <LI><strong><A NAME="00397" HREF="msg00397.html">Re: [MUD-Dev] DBs and Events</A></strong>, Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Tue 10 Feb 1998, 19:40 GMT <UL> <LI><strong><A NAME="00399" HREF="msg00399.html">Re: [MUD-Dev] DBs and Events</A></strong>, Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Wed 11 Feb 1998, 10:50 GMT <UL> <LI><strong><A NAME="00400" HREF="msg00400.html">DBs and Events</A></strong>, s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Wed 11 Feb 1998, 14:26 GMT <UL> <LI><strong><A NAME="00432" HREF="msg00432.html">OT: Linux g++</A></strong>, Greg Munt <a href="mailto:greg#uni-corn,demon.co.uk">greg#uni-corn,demon.co.uk</a>, Thu 12 Feb 1998, 11:52 GMT <UL> <LI><strong><A NAME="00444" HREF="msg00444.html">Re: [MUD-Dev] OT: Linux g++</A></strong>, Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Fri 13 Feb 1998, 00:30 GMT <UL> <LI><strong><A NAME="00487" HREF="msg00487.html">Re: [MUD-Dev] OT: Linux g++</A></strong>, coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Mon 16 Feb 1998, 11:29 GMT <UL> <LI><strong><A NAME="00526" HREF="msg00526.html">Re: [MUD-Dev] OT: Linux g++</A></strong>, Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Wed 18 Feb 1998, 17:02 GMT </LI> </UL> </LI> </UL> </LI> </UL> </LI> </UL> </LI> </UL> </LI> </UL> </LI> </UL> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>