Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sc2api : Update Convert CloakState #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/sc2api/sc2_unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class Unit {

//! Unit cloak state.
enum CloakState {
//! Under the fog, so unknown whether it's cloaked or not.
CloakedUnknown = 0,
//! Cloaked, invisible to enemies until detected.
Cloaked = 1,
//! Cloaked enemy, but detected.
Expand Down
1 change: 1 addition & 0 deletions src/sc2api/sc2_proto_to_pods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ bool Convert(const SC2APIProtocol::Alliance& alliance_proto, Unit::Alliance& all

bool Convert(const SC2APIProtocol::CloakState& cloak_proto, Unit::CloakState& cloak) {
switch (cloak_proto) {
case SC2APIProtocol::CloakState::CloakedUnknown: cloak = Unit::CloakedUnknown; return true;
case SC2APIProtocol::CloakState::Cloaked: cloak = Unit::Cloaked; return true;
case SC2APIProtocol::CloakState::CloakedDetected: cloak = Unit::CloakedDetected; return true;
case SC2APIProtocol::CloakState::NotCloaked: cloak = Unit::NotCloaked; return true;
Expand Down