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
Dawid Lukasz Abucewicz
PyCommandCenter
Commits
cca76409
Commit
cca76409
authored
6 years ago
by
Jonathan Öhrling
Browse files
Options
Downloads
Patches
Plain Diff
Changed tabs to spaces and pointers to references.
parent
47e9cfcb
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
+18
-18
18 additions, 18 deletions
python-api-src/library.cpp
src/IDABot.cpp
+6
-6
6 additions, 6 deletions
src/IDABot.cpp
src/IDABot.h
+4
-4
4 additions, 4 deletions
src/IDABot.h
with
28 additions
and
28 deletions
python-api-src/library.cpp
+
18
−
18
View file @
cca76409
...
@@ -64,24 +64,24 @@ PYBIND11_MODULE(library, m)
...
@@ -64,24 +64,24 @@ PYBIND11_MODULE(library, m)
// IDABot is a specialization of Agent
// IDABot is a specialization of Agent
py
::
class_
<
IDABot
,
PyIDABot
,
sc2
::
Agent
>
(
m
,
"IDABot"
)
py
::
class_
<
IDABot
,
PyIDABot
,
sc2
::
Agent
>
(
m
,
"IDABot"
)
.
def
(
py
::
init
())
.
def
(
py
::
init
())
.
def
(
"on_game_start"
,
&
IDABot
::
OnGameStart
)
.
def
(
"on_game_start"
,
&
IDABot
::
OnGameStart
)
.
def
(
"on_step"
,
&
IDABot
::
OnStep
)
.
def
(
"on_step"
,
&
IDABot
::
OnStep
)
.
def
(
"get_all_units"
,
&
IDABot
::
GetAllUnits
,
"Returns a list of all units"
)
.
def
(
"get_all_units"
,
&
IDABot
::
GetAllUnits
,
"Returns a list of all units"
)
.
def
(
"get_my_units"
,
&
IDABot
::
GetMyUnits
,
"Returns a list of all units beloning to the player"
)
.
def
(
"get_my_units"
,
&
IDABot
::
GetMyUnits
,
"Returns a list of all units beloning to the player"
)
.
def
(
"get_player_race"
,
&
IDABot
::
GetPlayerRace
)
.
def
(
"get_player_race"
,
&
IDABot
::
GetPlayerRace
)
.
def_property_readonly
(
"base_location_manager"
,
&
IDABot
::
Bases
)
.
def_property_readonly
(
"base_location_manager"
,
&
IDABot
::
Bases
)
.
def_property_readonly
(
"tech_tree"
,
&
IDABot
::
GetTechTree
)
.
def_property_readonly
(
"tech_tree"
,
&
IDABot
::
GetTechTree
)
.
def_property_readonly
(
"map_tools"
,
&
IDABot
::
Map
)
.
def_property_readonly
(
"map_tools"
,
&
IDABot
::
Map
)
.
def_property_readonly
(
"building_placer"
,
&
IDABot
::
GetBuildingPlacer
)
.
def_property_readonly
(
"building_placer"
,
&
IDABot
::
GetBuildingPlacer
)
.
def_property_readonly
(
"start_location"
,
&
IDABot
::
GetStartLocation
,
"CCPosition representing the start location"
)
.
def_property_readonly
(
"start_location"
,
&
IDABot
::
GetStartLocation
,
"CCPosition representing the start location"
)
.
def_property_readonly
(
"minerals"
,
&
IDABot
::
GetMinerals
,
"How much minerals we currently have"
)
.
def_property_readonly
(
"minerals"
,
&
IDABot
::
GetMinerals
,
"How much minerals we currently have"
)
.
def_property_readonly
(
"current_supply"
,
&
IDABot
::
GetCurrentSupply
,
"How much supply we are currently using"
)
.
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
(
"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
(
"gas"
,
&
IDABot
::
GetGas
,
"How much gas we currently have"
)
.
def
(
"use_ability"
,
&
IDABot
::
CallUnitCommand
,
"Use an ability with the given unit"
)
.
def
(
"use_ability"
,
&
IDABot
::
CallUnitCommand
,
"Use an ability with the given unit"
)
.
def
(
"use_ability"
,
&
IDABot
::
CallUnitCommandWithPoint
,
"Use ability at point with the given unit"
)
.
def
(
"use_ability"
,
&
IDABot
::
CallUnitCommandWithPoint
,
"Use ability at point with the given unit"
)
.
def
(
"use_ability"
,
&
IDABot
::
CallUnitCommandWithTarget
,
"Use ability at target with the given unit"
);
.
def
(
"use_ability"
,
&
IDABot
::
CallUnitCommandWithTarget
,
"Use ability at target with the given unit"
);
py
::
class_
<
sc2
::
PlayerSetup
>
(
m
,
"PlayerSetup"
);
py
::
class_
<
sc2
::
PlayerSetup
>
(
m
,
"PlayerSetup"
);
...
...
This diff is collapsed.
Click to expand it.
src/IDABot.cpp
+
6
−
6
View file @
cca76409
...
@@ -219,17 +219,17 @@ const TypeData & IDABot::Data(const MetaType & type) const
...
@@ -219,17 +219,17 @@ const TypeData & IDABot::Data(const MetaType & type) const
return
m_techTree
.
getData
(
type
);
return
m_techTree
.
getData
(
type
);
}
}
void
IDABot
::
CallUnitCommand
(
const
Unit
*
unit
,
sc2
::
AbilityID
ability
)
void
IDABot
::
CallUnitCommand
(
const
Unit
&
unit
,
sc2
::
AbilityID
ability
)
{
{
Actions
()
->
UnitCommand
(
unit
->
getUnitPtr
(),
ability
,
false
);
Actions
()
->
UnitCommand
(
unit
.
getUnitPtr
(),
ability
,
false
);
}
}
void
IDABot
::
CallUnitCommandWithPoint
(
const
Unit
*
unit
,
sc2
::
AbilityID
ability
,
const
sc2
::
Point2D
&
point
)
void
IDABot
::
CallUnitCommandWithPoint
(
const
Unit
&
unit
,
sc2
::
AbilityID
ability
,
const
sc2
::
Point2D
&
point
)
{
{
Actions
()
->
UnitCommand
(
unit
->
getUnitPtr
(),
ability
,
point
,
false
);
Actions
()
->
UnitCommand
(
unit
.
getUnitPtr
(),
ability
,
point
,
false
);
}
}
void
IDABot
::
CallUnitCommandWithTarget
(
const
Unit
*
unit
,
sc2
::
AbilityID
ability
,
const
Unit
*
target
)
void
IDABot
::
CallUnitCommandWithTarget
(
const
Unit
&
unit
,
sc2
::
AbilityID
ability
,
const
Unit
*
target
)
{
{
Actions
()
->
UnitCommand
(
unit
->
getUnitPtr
(),
ability
,
target
->
getUnitPtr
(),
false
);
Actions
()
->
UnitCommand
(
unit
.
getUnitPtr
(),
ability
,
target
->
getUnitPtr
(),
false
);
}
}
This diff is collapsed.
Click to expand it.
src/IDABot.h
+
4
−
4
View file @
cca76409
...
@@ -63,8 +63,8 @@ public:
...
@@ -63,8 +63,8 @@ public:
const
TypeData
&
Data
(
const
MetaType
&
type
)
const
;
const
TypeData
&
Data
(
const
MetaType
&
type
)
const
;
const
TypeData
&
Data
(
const
Unit
&
unit
)
const
;
const
TypeData
&
Data
(
const
Unit
&
unit
)
const
;
// Used for giving "raw" commands to units
// Used for giving "raw" commands to units
void
CallUnitCommand
(
const
Unit
*
unit
,
sc2
::
AbilityID
ability
);
void
CallUnitCommand
(
const
Unit
&
unit
,
sc2
::
AbilityID
ability
);
void
CallUnitCommandWithPoint
(
const
Unit
*
unit
,
sc2
::
AbilityID
ability
,
const
sc2
::
Point2D
&
point
);
void
CallUnitCommandWithPoint
(
const
Unit
&
unit
,
sc2
::
AbilityID
ability
,
const
sc2
::
Point2D
&
point
);
void
CallUnitCommandWithTarget
(
const
Unit
*
unit
,
sc2
::
AbilityID
ability
,
const
Unit
*
target
);
void
CallUnitCommandWithTarget
(
const
Unit
&
unit
,
sc2
::
AbilityID
ability
,
const
Unit
*
target
);
};
};
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