private static TBM.MatchStatus ToMatchStatus( string pendingParticipantId, Types.MatchStatus status) { switch (status) { case Types.MatchStatus.CANCELED: return(TBM.MatchStatus.Cancelled); case Types.MatchStatus.COMPLETED: return(TBM.MatchStatus.Complete); case Types.MatchStatus.EXPIRED: return(TBM.MatchStatus.Expired); case Types.MatchStatus.INVITED: return(TBM.MatchStatus.Active); case Types.MatchStatus.MY_TURN: return(TBM.MatchStatus.Active); case Types.MatchStatus.PENDING_COMPLETION: return(TBM.MatchStatus.Complete); case Types.MatchStatus.THEIR_TURN: // If it's their turn, but we don't have a valid pending participant, it's because // we're still automatching against that participant. return(pendingParticipantId == null ? TBM.MatchStatus.AutoMatching : TBM.MatchStatus.Active); default: return(TBM.MatchStatus.Unknown); } }
private static TBM.MatchTurnStatus ToTurnStatus(Types.MatchStatus status) { switch (status) { case Types.MatchStatus.CANCELED: return(TBM.MatchTurnStatus.Complete); case Types.MatchStatus.COMPLETED: return(TBM.MatchTurnStatus.Complete); case Types.MatchStatus.EXPIRED: return(TBM.MatchTurnStatus.Complete); case Types.MatchStatus.INVITED: return(TBM.MatchTurnStatus.Invited); case Types.MatchStatus.MY_TURN: return(TBM.MatchTurnStatus.MyTurn); case Types.MatchStatus.PENDING_COMPLETION: return(TBM.MatchTurnStatus.Complete); case Types.MatchStatus.THEIR_TURN: return(TBM.MatchTurnStatus.TheirTurn); default: return(TBM.MatchTurnStatus.Unknown); } }