API additions 31/7/2009 - 1/8/2009
Posted: 01 Aug 2009 00:50
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)
-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)