public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
From: Eric McDonald <mcdonald@phy.cmich.edu>
To: Christopher Wood <cwood@cs.pdx.edu>
Cc: xconq7@sources.redhat.com
Subject: Re: Question on combat procedures
Date: Mon, 05 Jul 2004 20:54:00 -0000	[thread overview]
Message-ID: <40E9BD9C.9020803@phy.cmich.edu> (raw)
In-Reply-To: <Pine.LNX.4.58.0407051317050.27768@jess.cs.pdx.edu>

Christopher Wood wrote:

> I am trying to figure out how these combat module works in the 
> xconq source code. I have looked over combat.c and I have seen
> how it switches depending on the model through the g_combat_model
> call. However what I would like is to know what is calling the 
> functions in combat and how the order is being done. The combat.c
> file is quite confusing and I can't quite figure out how it works
> together with the rest of the program since I have no idea where
> these functions are being called from. 

You need to account for the user interfaces. They are in separate 
directories; 'tcltk' houses the Tcl/Tk interface, for example. Also, the 
user interfaces make use of 'ui.h' and 'ui.c'. You should also look at 
'task.c' and 'plan.c'; 'task.c' contains the 'hit-unit' task code. The 
kernel run code in 'run.c' and 'action.c' is what actually schedules 
things to happen (i.e., running prepped actions).

Remember, grep is your friend:
$ grep 'prep_attack' *.c
combat.c:prep_attack_action(Unit *unit, Unit *unit2, Unit *defender, int n)
task.c:             prep_attack_action(unit, unit, unit2, 100);
task.c:                 prep_attack_action(unit, unit, unit2, 100);
task.c:                 prep_attack_action(unit, unit, unit2, 100);
task.c:             prep_attack_action(unit, unit, unit2, 100);
task.c:             prep_attack_action(unit, unit, unit2, 100);
tp.c:net_prep_attack_action(Unit *unit, Unit *unit2, Unit *defender, int n)
tp.c:   rslt = prep_attack_action(unit, unit2, defender, n);
ui.c:               net_prep_attack_action(unit, unit, other, 100);
ui.c:               net_prep_attack_action(unit, unit, other, 100);
$ grep 'do_attack' *.c
actions.c:      rslt = do_attack_action(unit, unit2, aunits[0], a[1]);
combat.c:do_attack_action(Unit *unit, Unit *unit2, Unit *defender, int n)

  reply	other threads:[~2004-07-05 20:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-04  0:05 xConq alternate combat engine project Ramsey
2004-07-04  0:24 ` Eric McDonald
2004-07-05 19:17   ` Christopher Wood
2004-07-05 20:18     ` Christopher Wood
2004-07-05 20:27     ` Eric McDonald
2004-07-05 20:44     ` Question on combat procedures Christopher Wood
2004-07-05 20:54       ` Eric McDonald [this message]
2004-07-05 21:25       ` Jim Kingdon
2004-07-05 22:12       ` Hans Ronne
2004-07-04  0:30 ` xConq alternate combat engine project Eric McDonald
2004-07-04  0:38   ` Eric McDonald
2004-07-04  0:45     ` Hans Ronne
2004-07-04  3:39   ` Christopher Wood
2004-07-04  5:22     ` Christopher Wood
2004-07-05  4:58     ` Elijah Meeks
2004-07-05 20:11       ` Christopher Wood
2004-07-04  0:43 ` Hans Ronne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40E9BD9C.9020803@phy.cmich.edu \
    --to=mcdonald@phy.cmich.edu \
    --cc=cwood@cs.pdx.edu \
    --cc=xconq7@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).