void OnScoreReported(Arbiter.CashChallenge challenge) { ScoreReported = true; if (challenge.Status == Arbiter.CashChallenge.StatusType.Closed) { if (challenge.Winner != null) { if (challenge.Winner.Id == Arbiter.UserId) { ResultsDescription = "You Won!"; } else { ResultsDescription = "You lost"; } } } else if (challenge.Status == Arbiter.CashChallenge.StatusType.Open || challenge.Status == Arbiter.CashChallenge.StatusType.Busy) { ResultsDescription = "You lost"; } else { Debug.LogError("Found unexpected status code (" + challenge.Status + ")!"); } }
public static Arbiter.CashChallenge ParseCashChallenge(JSONClass node) { if (node == null) { return(null); } Arbiter.CashChallenge.StatusType status = Arbiter.CashChallenge.StatusType.Unknown; switch (node["status"]) { case "open": status = Arbiter.CashChallenge.StatusType.Open; break; case "busy": status = Arbiter.CashChallenge.StatusType.Busy; break; case "closed": status = Arbiter.CashChallenge.StatusType.Closed; break; default: Debug.LogError("Unknown status encountered: " + node["status"]); break; } Arbiter.CashChallengeWinner winner = ParseWinner(node["winner"]); Arbiter.CashChallenge rv = new Arbiter.CashChallenge(node["id"], node["score_to_beat"], node["entry_fee"], node["prize"], status, winner); return(rv); }
// Once a Cash Challenge has been created, set that challenge to // the GameState that gets passed along to the ClickArenaManager ///////////////////////////////////////////////////////////////// void OnCashChallengeCreated(Arbiter.CashChallenge challenge) { gameState.challenge = challenge; }
void OnReportScoreSuccess(Arbiter.CashChallenge challenge) { gameState.challenge = challenge; outcomeReturned = true; }
void OnChallengeCreated(Arbiter.CashChallenge challenge) { ChallengeId = challenge.Id; ScoreToBeat = challenge.ScoreToBeat; }