Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "library.h"
namespace py = pybind11;
PYBIND11_MODULE(library, m)
{
m.doc() = "pybind11 example plugin";
py::class_<Coordinator>(m, "Coordinator")
.def(py::init())
.def("SetParticipants", &sc2::Coordinator::SetParticipants)
.def("LaunchStarcraft", &sc2::Coordinator::LaunchStarcraft)
.def("StartGame", &sc2::Coordinator::StartGame)
.def("Update", &sc2::Coordinator::Update);
py::enum_<sc2::Race>(m, "Race")
.value("Terran", sc2::Race::Terran)
.value("Zerg", sc2::Race::Zerg)
.value("Protoss", sc2::Race::Protoss)
.value("Random", sc2::Race::Random);
py::class_<sc2::Agent>(m, "Agent")
.def(py::init());
// IDABot is a specialization of Agent
py::class_<IDABot, sc2::Agent>(m, "IDABot")
.def(py::init());
py::class_<sc2::PlayerSetup>(m, "PlayerSetup");
py::enum_<sc2::Difficulty>(m, "Difficulty")
.value("VeryEasy", sc2::Difficulty::VeryEasy)
.value("Easy", sc2::Difficulty::Easy)
.value("Medium", sc2::Difficulty::Medium)
.value("MediumHard", sc2::Difficulty::MediumHard)
.value("Hard", sc2::Difficulty::Hard)
.value("HardVeryHard", sc2::Difficulty::HardVeryHard)
.value("VeryHard", sc2::Difficulty::VeryHard)
.value("CheatVision", sc2::Difficulty::CheatVision)
.value("CheatMoney", sc2::Difficulty::CheatMoney)
.value("CheatInsane", sc2::Difficulty::CheatInsane);
m.def("CreateParticipant", &sc2::CreateParticipant, "Create participant from agent");
m.def("CreateComputer", &sc2::CreateComputer, "Create participant from built-in Starcraft computer");
}