Skip to content

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

@heinermann

Description

@heinermann

From [email protected] on September 24, 2012 08:20:52

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

  • buildsWhat
  • researchesWhat
  • upgradesWhat
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: http://code.google.com/p/bwapi/issues/detail?id=463

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions