zloop1982 / bwapi

Automatically exported from code.google.com/p/bwapi
0 stars 0 forks source link

Add public UnitType methods: buildsWhat(), researchesWhat(), upgradesWhat() #463

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I would like to request that the following public methods (or something 
similar) be added to the UnitType class, just for convenience.

const UnitType::set& UnitType::buildsWhat() const;
const Typeset<TechType>& UnitType::researchesWhat() const;
const Typeset<UpgradeType>& UnitType::upgradesWhat() const;

Note that the following methods already exist - I just want to be able to 
quickly & easily look-up in the other direction:

const std::pair< UnitType, int > UnitType::whatBuilds() const;
UnitType TechType::whatResearches() const;
UnitType UpgradeType::whatUpgrades() const;

It's trivial to write my own methods to do what I want (i.e. build some lookup 
tables at startup, by iterating over all UnitType's, TechType's, UpgradeType's 
and calling the methods I mentioned above that already exist), but I just 
thought it would be nice if it was built into BWAPI and other botters could use 
them.

FYI, the reason this would be useful to me is so that my bot can quickly & 
easily iterate over units & the various kinds of commands, so that it can 
determine what commands each unit can perform before it has to start deciding 
what command(s) to perform.

Original issue reported on code.google.com by chris.c...@gmail.com on 24 Sep 2012 at 12:20

GoogleCodeExporter commented 9 years ago

Original comment by chris.c...@gmail.com on 24 Sep 2012 at 12:22

GoogleCodeExporter commented 9 years ago

Original comment by AHeinerm on 27 Sep 2012 at 2:19

GoogleCodeExporter commented 9 years ago
The BWAPI project is slowly undergoing the migration to GitHub. All issues have 
been migrated to the GitHub issue tracker located here: 
https://github.com/bwapi/bwapi/issues

In order to receive updates on your issue, please head over to the GitHub issue 
tracker and subscribe to your issue.

Original comment by AHeinerm on 15 Apr 2014 at 7:46