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
Iterations
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
Container 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
Starcraft AI Course
PyCommandCenter
Commits
1b164fb7
Commit
1b164fb7
authored
6 years ago
by
Sopi (sofab194)
Browse files
Options
Downloads
Patches
Plain Diff
fixed indents
fixed indents to match previously written code
parent
7a75dd33
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python-api-src/library.cpp
+1
-1
1 addition, 1 deletion
python-api-src/library.cpp
src/Unit.cpp
+23
-23
23 additions, 23 deletions
src/Unit.cpp
src/Unit.h
+2
-2
2 additions, 2 deletions
src/Unit.h
with
26 additions
and
26 deletions
python-api-src/library.cpp
+
1
−
1
View file @
1b164fb7
...
...
@@ -79,7 +79,7 @@ PYBIND11_MODULE(library, m)
.
def_property_readonly
(
"current_supply"
,
&
IDABot
::
GetCurrentSupply
,
"How much supply we are currently using"
)
.
def_property_readonly
(
"max_supply"
,
&
IDABot
::
GetMaxSupply
,
"How much supply we can currently use"
)
.
def_property_readonly
(
"gas"
,
&
IDABot
::
GetGas
,
"How much gas we currently have"
)
.
def_property_readonly
(
"current_frame"
,
&
IDABot
::
GetCurrentFrame
,
"Which frame we are currently on"
);
.
def_property_readonly
(
"current_frame"
,
&
IDABot
::
GetCurrentFrame
,
"Which frame we are currently on"
);
py
::
class_
<
sc2
::
PlayerSetup
>
(
m
,
"PlayerSetup"
);
...
...
This diff is collapsed.
Click to expand it.
src/Unit.cpp
+
23
−
23
View file @
1b164fb7
...
...
@@ -300,42 +300,42 @@ bool Unit::isConstructing(const UnitType & type) const
Unit
Unit
::
getTarget
()
const
{
BOT_ASSERT
(
isValid
(),
"Unit is not valid"
);
BOT_ASSERT
(
hasTarget
(),
"Unit has no target"
);
BOT_ASSERT
(
isValid
(),
"Unit is not valid"
);
BOT_ASSERT
(
hasTarget
(),
"Unit has no target"
);
//if unit has order, check tag of target of first order
if
(
getUnitPtr
()
->
orders
.
size
()
>
0
){
//t_id is set to the unit tag of the target
CCUnitID
t_id
=
getUnitPtr
()
->
orders
[
0
].
target_unit_tag
;
//IDAbot finds the unit with this tag
return
m_bot
->
GetUnit
(
t_id
);
}
//if unit has order, check tag of target of first order
if
(
getUnitPtr
()
->
orders
.
size
()
>
0
){
//t_id is set to the unit tag of the target
CCUnitID
t_id
=
getUnitPtr
()
->
orders
[
0
].
target_unit_tag
;
//IDAbot finds the unit with this tag
return
m_bot
->
GetUnit
(
t_id
);
}
Unit
this_unit
=
Unit
(
m_unit
,
*
m_bot
);
return
this_unit
;
Unit
this_unit
=
Unit
(
m_unit
,
*
m_bot
);
return
this_unit
;
}
bool
Unit
::
hasTarget
()
const
{
BOT_ASSERT
(
isValid
(),
"Unit is not valid"
);
BOT_ASSERT
(
isValid
(),
"Unit is not valid"
);
if
(
getUnitPtr
()
->
orders
.
size
()
>
0
)
{
if
(
getUnitPtr
()
->
orders
[
0
].
target_unit_tag
!=
NULL
)
{
CCUnitID
t_id
=
getUnitPtr
()
->
orders
[
0
].
target_unit_tag
;
//IDAbot finds the unit with this tag, and returns true if valid
return
m_bot
->
GetUnit
(
t_id
).
isValid
();
}
}
if
(
getUnitPtr
()
->
orders
.
size
()
>
0
)
{
if
(
getUnitPtr
()
->
orders
[
0
].
target_unit_tag
!=
NULL
)
{
CCUnitID
t_id
=
getUnitPtr
()
->
orders
[
0
].
target_unit_tag
;
//IDAbot finds the unit with this tag, and returns true if valid
return
m_bot
->
GetUnit
(
t_id
).
isValid
();
}
}
return
false
;
return
false
;
}
bool
Unit
::
isBlip
()
const
{
BOT_ASSERT
(
isValid
(),
"Unit is not valid"
);
BOT_ASSERT
(
isValid
(),
"Unit is not valid"
);
#ifdef SC2API
return
m_unit
->
is_blip
;
return
m_unit
->
is_blip
;
#else
return
m_unit
->
isBlip
();
return
m_unit
->
isBlip
();
#endif
}
This diff is collapsed.
Click to expand it.
src/Unit.h
+
2
−
2
View file @
1b164fb7
...
...
@@ -48,8 +48,8 @@ public:
bool
isConstructing
(
const
UnitType
&
type
)
const
;
bool
isBlip
()
const
;
bool
hasTarget
()
const
;
Unit
getTarget
()
const
;
bool
hasTarget
()
const
;
Unit
getTarget
()
const
;
void
stop
()
const
;
void
attackUnit
(
const
Unit
&
target
)
const
;
...
...
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