Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyCommandCenter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Ahlroth
PyCommandCenter
Commits
cb537558
Commit
cb537558
authored
6 years ago
by
David Bergström
Browse files
Options
Downloads
Patches
Plain Diff
Add ability to manually specify the path for the SC2 binary
parent
58d11644
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python-api-src/library.cpp
+1
-0
1 addition, 0 deletions
python-api-src/library.cpp
python-api-src/library.h
+18
-4
18 additions, 4 deletions
python-api-src/library.h
with
19 additions
and
4 deletions
python-api-src/library.cpp
+
1
−
0
View file @
cb537558
...
@@ -19,6 +19,7 @@ PYBIND11_MODULE(library, m)
...
@@ -19,6 +19,7 @@ PYBIND11_MODULE(library, m)
py
::
class_
<
Coordinator
>
(
m
,
"Coordinator"
)
py
::
class_
<
Coordinator
>
(
m
,
"Coordinator"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
())
.
def
(
py
::
init
<
std
::
string
>
())
.
def
(
"set_participants"
,
&
sc2
::
Coordinator
::
SetParticipants
,
"participants"
_a
)
.
def
(
"set_participants"
,
&
sc2
::
Coordinator
::
SetParticipants
,
"participants"
_a
)
.
def
(
"launch_starcraft"
,
&
sc2
::
Coordinator
::
LaunchStarcraft
)
.
def
(
"launch_starcraft"
,
&
sc2
::
Coordinator
::
LaunchStarcraft
)
.
def
(
"start_game"
,
&
sc2
::
Coordinator
::
StartGame
,
"map_path"
_a
)
.
def
(
"start_game"
,
&
sc2
::
Coordinator
::
StartGame
,
"map_path"
_a
)
...
...
This diff is collapsed.
Click to expand it.
python-api-src/library.h
+
18
−
4
View file @
cb537558
...
@@ -14,12 +14,26 @@ using namespace pybind11::literals;
...
@@ -14,12 +14,26 @@ using namespace pybind11::literals;
class
Coordinator
:
public
sc2
::
Coordinator
class
Coordinator
:
public
sc2
::
Coordinator
{
{
public:
public:
// TODO: We might not always want default value when we run on Linux
Coordinator
()
:
sc2
::
Coordinator
()
Coordinator
()
:
sc2
::
Coordinator
()
{
{
char
*
argv
[]
=
{
"executable"
,
NULL
};
std
::
vector
<
std
::
string
>
arguments
=
{
"pycommandcenter"
};
int
argc
=
sizeof
(
argv
)
/
sizeof
(
char
*
)
-
1
;
CustomLoadSettings
(
arguments
);
LoadSettings
(
argc
,
argv
);
}
Coordinator
(
std
::
string
path
)
:
sc2
::
Coordinator
()
{
std
::
vector
<
std
::
string
>
arguments
=
{
"pycommandcenter"
,
"-e"
,
path
};
CustomLoadSettings
(
arguments
);
}
void
CustomLoadSettings
(
std
::
vector
<
std
::
string
>
arguments
)
{
std
::
vector
<
char
*>
argv
;
for
(
const
auto
&
arg
:
arguments
)
argv
.
push_back
((
char
*
)
arg
.
data
());
argv
.
push_back
(
nullptr
);
LoadSettings
(
argv
.
size
()
-
1
,
argv
.
data
());
}
}
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment