1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: CORBA, RMI, threads -->
<!--X-From-R13: f001tzhNabin.jevtug.rqh -->
<!--X-Date: Thu, 29 Jan 1998 14:46:16 +0000 -->
<!--X-Message-Id: Pine.PMDF.3.95.980129091651.543268706A&#45;100000#nova,wright.edu -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 34CF03BA.167EB0E7#efrei,fr -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, CORBA, RMI, threads</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>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00339.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00341.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00334.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00468.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00340">Author</A>
&nbsp;|&nbsp;<A HREF="#00340">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00340">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>CORBA, RMI, threads</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>: CORBA, RMI, threads</LI>
<LI><em>From</em>: <A HREF="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</A></LI>
<LI><em>Date</em>: Thu, 29 Jan 1998 09:46:19 -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, 28 Jan 1998, Marc Eyrignoux wrote:

&gt; Now I have a question for Greg: you told me my code should look like:
&gt; &gt; event_diver.schedule(new event(real_to_game_time(t)));
&gt; But in this case, how do I know what the events refers?
&gt; In the constructor, I only store the delay, but not the method that has
&gt; to be executed when the delay will be attained?

How you handle events is pretty simple... simply write a handle() method.
the driver calls:

  event.handle(); // passing args if you feel it necessary

whenever the event's delay time has passed.  Just descend all the event
classes you need from the generic event class, each one overriding the
inhereted handle() method.  When you make the call to add the event to the
queue, you need to specify what kind of event, rather than the generic
event (the sample schedule call was used to demonstrate how to use the
time conversion function).  As far as the driver is concerned, it's
dealing with generic events and it doesn't care what handle() eventually
gets called (ain't polymorphism and late binding great? :)

So, to reuse my schedule example, you could have several different
calls like so:

  event_driver.schedule(new combat_event(real_to_game_time(t), attacker,
                                         defender));
  event_driver.schedule(new heal_event(real_to_game_time(t), target,
                                       amount));

etc.  Each event class descended from the generic event has it's own
handle() method.  You'll also want to have each descended event class's 
constructors take arguments of pertinent data, as above.  You can make the
inheretence tree as broad and deep as you like, depending on how you
choose to organize things.

&lt;rant&gt;
There are other ways of doing things which are less object oriented in
their design (like registering callback functions).  There is no one way
that your code "should" look.  Always keep in mind that there is no
"right" solution to any problem.  There are many solutions with varrying
degrees of effectiveness, based on your assumptions and understanding of
the problem.  Lines like "how should my code look" really bother me...
&lt;/rant&gt;

 -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="00468" HREF="msg00468.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></strong>
<ul compact><li><em>From:</em> coder#ibm,net</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00334" HREF="msg00334.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></STRONG>
<UL><LI><EM>From:</EM> Marc Eyrignoux &lt;Marc.Eyrignoux#efrei,fr&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00339.html">Re: [MUD-Dev] Arctic's Project?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00341.html">Re: [MUD-Dev] Arctic's Project?</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00334.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00468.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00340"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00340"><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>Re: [MUD-Dev]  CORBA, RMI, threads</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00323" HREF="msg00323.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></strong>, 
Marc Eyrignoux <a href="mailto:Marc.Eyrignoux#efrei,fr">Marc.Eyrignoux#efrei,fr</a>, Mon 26 Jan 1998, 16:40 GMT
<UL>
<LI><strong><A NAME="00324" HREF="msg00324.html">CORBA, RMI, threads</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Mon 26 Jan 1998, 20:37 GMT
</LI>
<LI><strong><A NAME="00331" HREF="msg00331.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></strong>, 
Brandon Gillespie <a href="mailto:brandon#roguetrader,com">brandon#roguetrader,com</a>, Tue 27 Jan 1998, 21:26 GMT
<UL>
<LI><strong><A NAME="00334" HREF="msg00334.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></strong>, 
Marc Eyrignoux <a href="mailto:Marc.Eyrignoux#efrei,fr">Marc.Eyrignoux#efrei,fr</a>, Wed 28 Jan 1998, 10:09 GMT
<UL>
<LI><strong><A NAME="00340" HREF="msg00340.html">CORBA, RMI, threads</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Thu 29 Jan 1998, 14:46 GMT
<LI><strong><A NAME="00468" HREF="msg00468.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Sun 15 Feb 1998, 13:38 GMT
<LI><strong><A NAME="00471" HREF="msg00471.html">CORBA, RMI, threads</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Mon 16 Feb 1998, 01:53 GMT
</LI>
</LI>
</LI>
<LI><strong><A NAME="00342" HREF="msg00342.html">Re: [MUD-Dev]  CORBA, RMI, threads</A></strong>, 
Brandon Gillespie <a href="mailto:brandon#roguetrader,com">brandon#roguetrader,com</a>, Thu 29 Jan 1998, 15:53 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</ul>
</ul>
</ul>
</ul>
<LI><strong><A NAME="00012" HREF="msg00012.html">Re: [MUD-Dev] The impact of the web on muds</A></strong>, 
Mike Sellers <a href="mailto:mike#online-alchemy,com">mike#online-alchemy,com</a>, Fri 02 Jan 1998, 21:21 GMT
</LI>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>