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

Support for CloackedAllied #310

Closed
mboedigh opened this issue Jun 26, 2019 · 2 comments
Closed

Support for CloackedAllied #310

mboedigh opened this issue Jun 26, 2019 · 2 comments

Comments

@mboedigh
Copy link

all_tests fails because observation implementation cannot convert all cloacked states
I don't know how to make pull request but in sc2_unit.h add new enum CloackedAllied

    //! Unit cloak state.
    enum CloakState {
        //! Cloaked, invisible to enemies until detected.
        Cloaked = 1,
        //! Cloaked enemy, but detected.
        CloakedDetected = 2,
        //! No cloaking.
        NotCloaked = 3,
        //! Cloacked ally, but detected, as always 
        CloackedAllied = 5,
        //! Could not determine cloaking state.
        Unknown = 5,
    };

And in sc2_proto_to_pods.cc add case statement to switch statement and convert the raw observation

bool Convert(const SC2APIProtocol::CloakState& cloak_proto, Unit::CloakState& cloak) {
    switch (cloak_proto) {
        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;
        case SC2APIProtocol::CloakState::CloakedAllied:   cloak = Unit::CloackedAllied; return true;
        case SC2APIProtocol::CloakState::CloakedUnknown:  cloak = Unit::Unknown; return true;
    }
    return false;
}
@mboedigh
Copy link
Author

I believe this might be closed by #306

@piroxiljin
Copy link

In fact #306 added only CloakedUnknown = 0 state.

But I will try to check this issue and will update my PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants