Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyCommandCenter v2
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
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
Jonas Bonnaudet
PyCommandCenter v2
Commits
570f99b3
Commit
570f99b3
authored
6 years ago
by
Sopi Abaied
Browse files
Options
Downloads
Patches
Plain Diff
Added isBlip() and getTarget() to Unit
parent
05af0f93
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
src/Unit.cpp
+26
-1
26 additions, 1 deletion
src/Unit.cpp
src/Unit.h
+3
-0
3 additions, 0 deletions
src/Unit.h
with
29 additions
and
1 deletion
src/Unit.cpp
+
26
−
1
View file @
570f99b3
...
...
@@ -296,4 +296,29 @@ bool Unit::isConstructing(const UnitType & type) const
{
sc2
::
AbilityID
buildAbility
=
m_bot
->
Data
(
type
).
buildAbility
;
return
(
getUnitPtr
()
->
orders
.
size
()
>
0
)
&&
(
getUnitPtr
()
->
orders
[
0
].
ability_id
==
buildAbility
);
}
\ No newline at end of file
}
Unit
Unit
::
getTarget
()
const
{
BOT_ASSERT
(
isValid
(),
"Unit is not valid"
);
//if unit has order, check tag of target of first order
if
(
getUnitPtr
()
->
orders
.
size
()
>
0
){
//pray that this value can be declared as CCUnitID
CCUnitID
t_id
=
getUnitPtr
()
->
orders
[
0
].
target_unit_tag
;
//let IDAbot find the unit with this tag
return
m_bot
->
GetUnit
(
t_id
);
}
return
;
}
bool
Unit
::
isBlip
()
const
{
BOT_ASSERT
(
isValid
(),
"Unit is not valid"
);
#ifdef SC2API
return
m_unit
->
is_blip
;
#else
return
m_unit
->
isBlip
();
#endif
}
This diff is collapsed.
Click to expand it.
src/Unit.h
+
3
−
0
View file @
570f99b3
...
...
@@ -47,6 +47,9 @@ public:
bool
isTraining
()
const
;
bool
isConstructing
(
const
UnitType
&
type
)
const
;
bool
isBlip
()
const
;
Unit
getTarget
()
const
;
void
stop
()
const
;
void
attackUnit
(
const
Unit
&
target
)
const
;
void
attackMove
(
const
CCPosition
&
targetPosition
)
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