Summary: def_ai_xxx_data() callers to pass ai type.
                 Project: Freeciv
            Submitted by: cazfi
            Submitted on: Wed 08 Aug 2012 05:21:24 PM EEST
                Category: ai
                Priority: 5 - Normal
                  Status: Ready For Test
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 2.5.0



Instead of def_ai_xxx_data() to lookup for default ai type itself, it takes ai
type as parameter.

This might seems like step backward (every caller needing to make identical
lookup operation instead of it being centralized), but it moves the bad lookup
upwards so one can search codebase for the lookups to get rid of.
Matthias wanted to implement luaai, that would fallback to default ai code. I
think threaded AI could also in first phase reuse at least some of the default
ai code. Similar situation can come up with further ai type projects. Such
default ai reuse is currently impossible because these default ai type
lookups. If one calls default ai functions, they access data in default ai
context, not in that of calling ai type.


File Attachments:

Date: Wed 08 Aug 2012 05:21:24 PM EEST  Name: DefAiCallerType.patch.bz2  Size:
9kB   By: cazfi



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to