URL: <http://gna.org/patch/?4990>
Summary: Consider improvement side effects other than buildable units Project: Freeciv Submitted by: persia Submitted on: Sat 26 Jul 2014 10:24:21 AM JST Category: general Priority: 5 - Normal Status: Ready For Test Privacy: Public Assigned to: persia Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: 2.6.0 _______________________________________________________ Details: The improvements feature cache hasn't kept up with wider implementation of requirements vectors, so the only feature considered was whether the improvement provided buildable units. The attached patch extends that to also check for buildable extras, prevented disasters, and protection against diplomatic actions, in a somewhat generalised way such that other requirement vectors may be added easily. As part of this, universal_fulfills_requirement has been extended to allow the caller to specify whether the universal in question must be necessary to fulfill the requirements, or if the requirements must simply be allowed to be met in the presence of the universal, to enable asking both "Is this improvement necessary in order to build this extra?", and "Is this disaster impossible in the presence of this improvement?". This facility can also be used to ask "Can this unit perform this action?" (we don't care if the unit is required, as long as the requirements can be met with the unit), and "Does this technology obsolete this improvement?". Note that there are currently no callers outside improvement.c, so the function could be made static, but I anticipate using this in the AI code, so would prefer to leave it exposed for now. For my development convenience, there is a textual dependency on having applied patch #4989, but no functional dependency (although if this is adjusted to not have such a dependency, patch #4989 will need adjustment to use the altered call semantics of universal_fulfills_requirement() introduced here). _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Sat 26 Jul 2014 10:24:21 AM JST Name: consider-improvement-side-effects-other-than-buildable-units.patch Size: 13kB By: persia <http://gna.org/patch/download.php?file_id=21558> _______________________________________________________ Reply to this item at: <http://gna.org/patch/?4990> _______________________________________________ Message sent via/by Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev