ANE-Android-Expansion icon indicating copy to clipboard operation
ANE-Android-Expansion copied to clipboard

ExpansionManager.checkStatus() seems broken

Open id-ilych opened this issue 10 years ago • 1 comments

https://github.com/alebianco/ANE-Android-Expansion/blob/master/source/actionscript/agnostic/src/eu/alebianco/air/extensions/expansion/ExpansionManager.as

switch(true)
{
    case status && STATUS_SECURITY == 0:
    {
        message = "You havent configured the market security. Plase call setupMarketSecurity() to setup your data.";
        break;
    }

    case status && STATUS_EXPANSIONS == 0:
    {
        message = "You haven't required any expansion file, so why bothering to use this extension at all?";
        break;
    }
}

I guess binary & was intended rather than logical && If I get it correctly then it never true now as neither 'STATUS_SECURITY == 0' nor 'STATUS_EXPANSIONS == 0' are true.

Also what's the point in writing it this way instead of if-else if?

id-ilych avatar May 26 '15 18:05 id-ilych

absolutely right, rookie mistake on the operators. thanks for pointing it out.

the why is ... i like it better. especially when there're more statuses to handle i prefer a list of cases than a chain of if-elses. Technically there's no difference but i think it's easier on the eyes ...

alebianco avatar May 27 '15 09:05 alebianco