Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
some update.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenkun.tzk committed Jan 20, 2017
1 parent 956c1a8 commit a9bd231
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -23,4 +23,4 @@ Python wrapper for [TorchCraft](https://github.com/TorchCraft/TorchCraft), a bri
python attack_weakest.py --ip $server_ip --port $server_port
```

The `$server_ip` and `$server_port` are the ip and port of the server running StarCraft.
The `$server_ip` and `$server_port` are the ip and port of the server running StarCraft.
15 changes: 14 additions & 1 deletion torchcraft_py/proto.py
Expand Up @@ -672,11 +672,24 @@ def concat_cmd(cmd, *args):


def is_building(unit_type_id):
return unit_types['Terran_Comsat_Station'] <= unit_type_id \
return unit_types['Terran_Command_Center'] <= unit_type_id \
<= unit_types['Protoss_Shield_Battery']


def is_worker(unit_type_id):
return unit_type_id == unit_types['Protoss_Probe'] \
or unit_type_id == unit_types['Terran_SCV'] \
or unit_type_id == unit_types['Zerg_Drone']


def is_mineral_field(unit_type_id):
return unit_type_id == unit_types['Resource_Mineral_Field'] \
or unit_type_id == unit_types['Resource_Mineral_Field_Type_2'] \
or unit_type_id == unit_types['Resource_Mineral_Field_Type_3']


def is_gas_geyser(unit_type_id):
return unit_type_id == unit_types['Resource_Vespene_Geyser'] \
or unit_type_id == unit_types['Protoss_Assimilator'] \
or unit_type_id == unit_types['Terran_Refinery'] \
or unit_type_id == unit_types['Zerg_Extractor']

0 comments on commit a9bd231

Please sign in to comment.