Complete.Org: Mailing Lists: Archives: freeciv-ai: March 2004:
[freeciv-ai] Re: simple historian agent

[freeciv-ai] Re: simple historian agent

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: simple historian agent
From: nikodimka <nikodimka@xxxxxxxxx>
Date: Thu, 25 Mar 2004 16:08:06 -0800 (PST)


The majority of your suggestions accepted with thankfull silence.
Thank you.
Some require more clarifications.

> >   strcpy(, "Simple Historian");
> strlcpy

What is it? I don't think you mean the cool OpenBSDism.
Do you mean strncpy?

> >   simple_historian_agent.level = 98; /* well which level this should
> >                                     be to recieve change
> >                                     notification after all others? */
> Good question.

I can add

#define DEEPEST_AGENT_LEVEL 99 /* Don't use the last level unless you know what 
you're doing */

into agents.h

and change the line into simple_historian_agent.level = LAST_AGENT_LEVEL;

if you have no better suggestion.

> > void sha_tile_update(int index) {
> >
> >   int x; int y;
> >   
> >   freelog(LOG_DEBUG, "sha got tile: %d\n", index);
> >   
> >   index_to_map_pos(&x, &y, index); 
> >   /* Yes. decode and encode again. I could not find a function :( */
> >   previous_tiles[index] = *map_get_tile(x, y);
> > }
> IMHO the agents.c should do the callback with x and y and not with
> index.

This is because struct call's arg is of int type 
so I am not sure if you plan to extend this to something other type 
like union of possible arg types. Hence on the basis of Occam's razor 
I made it int.

The second issue is: "in which coordinate system these x,y should be?"
the "index" allways has well defined meaning whereas x,y is something 
pretty fuzzy as far as I can tell.

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

[Prev in Thread] Current Thread [Next in Thread]