Skip to content
Snippets Groups Projects
Commit 556236b7 authored by Hannes Jämtner's avatar Hannes Jämtner
Browse files

Updated docs and found more updated techtree

parent 9109a1f8
No related branches found
No related tags found
No related merge requests found
...@@ -10,3 +10,6 @@ ...@@ -10,3 +10,6 @@
[submodule "lib/json"] [submodule "lib/json"]
path = lib/json path = lib/json
url = https://github.com/nlohmann/json.git url = https://github.com/nlohmann/json.git
[submodule "lib/sc2-techtree"]
path = lib/sc2-techtree
url = https://github.com/BurnySc2/sc2-techtree.git
...@@ -81,8 +81,10 @@ TechTree ...@@ -81,8 +81,10 @@ TechTree
This class has some invalid information by default, this can be corrected by This class has some invalid information by default, this can be corrected by
placing the file `techtree.json` in the working directory. The placing the file `techtree.json` in the working directory. The
`techtree.json` files are available here_, select the lastest version. A `techtree.json` files are available here_, select the lastest version.
recent file is included in the `template repository`_. A techtree for SC2 version >=4.10 is now available (not fully tested yet),
this can be found under the folder data in this link_.
A recent file is included in the `template repository`_.
.. method:: get_data(argument) -> library.TypeData .. method:: get_data(argument) -> library.TypeData
...@@ -90,6 +92,7 @@ TechTree ...@@ -90,6 +92,7 @@ TechTree
an instance of the class :class:`library.CCUpgrade`, depending on what an instance of the class :class:`library.CCUpgrade`, depending on what
information is wanted. information is wanted.
.. _link: https://github.com/BurnySc2/sc2-techtree
.. _here: https://github.com/noorus/sc2-gamedata .. _here: https://github.com/noorus/sc2-gamedata
.. _`template repository`: https://gitlab.liu.se/starcraft-ai-course/sc2-python-bot .. _`template repository`: https://gitlab.liu.se/starcraft-ai-course/sc2-python-bot
...@@ -100,6 +103,7 @@ TypeData ...@@ -100,6 +103,7 @@ TypeData
:members: :members:
:undoc-members: :undoc-members:
.. TODO: Types for all fields would be nice, is required_units List[UnitType] or List[UNIT_TYPEID]? .. TODO: Types for all fields would be nice, is required_units List[UnitType] or List[UNIT_TYPEID]?
MapTools MapTools
...@@ -120,6 +124,9 @@ MapTools ...@@ -120,6 +124,9 @@ MapTools
this suffix uses the same coordinate system as the game, i.e. world this suffix uses the same coordinate system as the game, i.e. world
coordinates. coordinates.
The top three methods below takes in a Point2D, but it's possible to
send in x and y as floats instead of Point2D.
.. automethod:: draw_box .. automethod:: draw_box
.. automethod:: draw_circle .. automethod:: draw_circle
.. automethod:: draw_line .. automethod:: draw_line
......
...@@ -43,6 +43,7 @@ UPGRADE_ID ...@@ -43,6 +43,7 @@ UPGRADE_ID
EFFECT_ID EFFECT_ID
---------- ----------
EffectID is for things like ravager bile, or fungal or even a scan.
.. autoclass:: library.EFFECT_ID .. autoclass:: library.EFFECT_ID
:members: :members:
......
Subproject commit c92eaf8d8cee8bda4a19f95d81b43d65f23174a9
...@@ -20,9 +20,9 @@ void define_tech_tree(py::module & m) ...@@ -20,9 +20,9 @@ void define_tech_tree(py::module & m)
.def_readonly("build_ability", &TypeData::buildAbility, "the ability that creates this item") .def_readonly("build_ability", &TypeData::buildAbility, "the ability that creates this item")
.def_readonly("warp_ability", &TypeData::warpAbility, "the ability that creates this item via warp-in") .def_readonly("warp_ability", &TypeData::warpAbility, "the ability that creates this item via warp-in")
.def_readonly("what_builds", &TypeData::whatBuilds, "any of these units can build the item") .def_readonly("what_builds", &TypeData::whatBuilds, "any of these units can build the item")
.def_readonly("required_units", &TypeData::requiredUnits, "owning ONE of these is required to make") .def_readonly("required_units", &TypeData::requiredUnits, "owning ONE of these is required to make -> List[UnitType]")
.def_readonly("required_upgrades", &TypeData::requiredUpgrades, "having ALL of these is required to make") .def_readonly("required_upgrades", &TypeData::requiredUpgrades, "having ALL of these is required to make -> List[UPGRADE_ID]")
.def_readonly("required_addons", &TypeData::requiredAddons, "a unit of this type must be present next to the producer"); .def_readonly("required_addons", &TypeData::requiredAddons, "a unit of this type must be present next to the producer -> List[UnitType]");
py::class_<TechTree>(m, "TechTree") py::class_<TechTree>(m, "TechTree")
.def("get_data", py::overload_cast<const UnitType &>(&TechTree::getData, py::const_)) .def("get_data", py::overload_cast<const UnitType &>(&TechTree::getData, py::const_))
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment