For those of you who don't follow the commit log, here a summary of the API changes / additions in the past hours. For the documentation I'll refer you to api docs that'll be regenerated with the next nightly. If you have any questions about the newly added functions, feel free to ask them here. For discussion about other functions you think should be added, we have the topic Some API extension ideas.
-Add [NoAI]: AIAbstractList::SORT_ASCENDING / SORT_DESCENDING (svn r17005)
You can still use true/false as second parameter for AIAbstractList.Sort, but it's recommended to use the constants AIAbstractList.SORT_ASCENDING (=true) and AIAbstractList.SORT_DESCENDING (=false).
-Change [NoAI]: Add AIBaseStation as a parentclass for AIStation and AIWaypoint, and move GetName, SetName and GetLocation to AIBaseStation (svn r17011)
In trunk waypoints are internally stations now and this change has been reflected in the API. Nothing to worry about, since AIStation.GetName will still work. This change won't be backported to 0.7 so if you plan to stay compatible to 0.7 don't use AIBaseStation but call its functions on AIStation/AIWaypoint.
-Add [NoAI]: AIBaseStation::GetConstructionDate(StationID) (svn r17012)
This will probably get backported as AISation::GetConstructionDate with a possible duplicate in AIWaypoint. It returns a date, use AIDate to extract year/month/day out of it.
-Add [NoAI]: AIEngine::GetDesignDate(EngineID) (svn r17014)
Get the design date of an engine (it's a date, not a year).
-Add [NoAI]: AICompany::Get/Set PresidentGender (svn r17016)
API additions 31/7/2009 - 1/8/2009
Moderator: OpenTTD Developers
Re: API additions 31/7/2009 - 1/8/2009
Together with the change below you are awesome! Thank you Yexo.
Yexo in the 'some API extension ideas' thread wrote:
- Load latest version of AI that can load the data, don't load exact same version first.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: API additions 31/7/2009 - 1/8/2009
Thanks yexo
Re: API additions 31/7/2009 - 1/8/2009
Thank you !
Re: API additions 31/7/2009 - 1/8/2009
Thanks, it was great 

Who is online
Users browsing this forum: No registered users and 3 guests