[freeciv-ai] Re: patch/rfc: goto and move/attack test wrapping
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 18 Nov 2002, Per I. Mathisen wrote:
> Taken from massive ai. Unless I get disagreeing comments, I will commit
> these wrappers and the associated changes in the rest of the code.
>
> This is an important API decision so please consider it carefully.
>
> gothere is used for goto over several turns and goto with ferries, and is
> the one which should eventually be expanded into a replacement for
> military and settler gothere with associated ferrying capability. Before
> calling it, always set goto destination explicitly.
>
> goto is for one-turn gotos, for example run off and attack a target of
> opportunity. It will _retain_ existing goto destination and role, ie it is
> non-destructive for existing missions.
>
> can_move is a wrapper which enables you to test for movement _without
> going ACTIVITY_IDLE first_. This way, if you decide not to move after all,
> your fortify status remains unchanged.
>
> can_attack is the same for attack tests.
>
> (The two latter are necessary but not sufficient to avoid the AI's
> always-break fortification syndrome.)
Attached is a full patch. Please read. Will commit it in a week or so
(when I get some time again), unless someone beat me to it ... *wink*
- Per
wrapgoto1.diff
Description: Text document
|
|