Beispiel #1
0
    //--------------------------------------
    // UTILS
    //--------------------------------------

    public static GP_Participant ParseParticipanData(string[] data, int index)
    {
        GP_Participant participant = new GP_Participant(data[index], data[index + 1], data[index + 2], data[index + 3], data[index + 4], data[index + 5]);

        bool hasResult = Convert.ToBoolean(data[index + 6]);

        if (hasResult)
        {
            GP_ParticipantResult r = new GP_ParticipantResult(data, index + 7);
            participant.SetResult(r);
        }

        return(participant);
    }
Beispiel #2
0
    public void FinishMatch(string matchId, byte[] matchData, params UM_TMB_ParticipantResult[] results)
    {
        List <GP_ParticipantResult> resultsList = new List <GP_ParticipantResult>();

        foreach (UM_TMB_ParticipantResult r in results)
        {
            GP_TBM_ParticipantResult result = GP_TBM_ParticipantResult.MATCH_RESULT_UNINITIALIZED;
            switch (r.Outcome)
            {
            case UM_TBM_Outcome.Won:
                result = GP_TBM_ParticipantResult.MATCH_RESULT_WIN;
                break;

            case UM_TBM_Outcome.Lost:
                result = GP_TBM_ParticipantResult.MATCH_RESULT_LOSS;
                break;

            case UM_TBM_Outcome.Tied:
                result = GP_TBM_ParticipantResult.MATCH_RESULT_TIE;
                break;

            case UM_TBM_Outcome.Disconnected:
                result = GP_TBM_ParticipantResult.MATCH_RESULT_DISCONNECT;
                break;

            case UM_TBM_Outcome.None:
                result = GP_TBM_ParticipantResult.MATCH_RESULT_UNINITIALIZED;
                break;
            }

            GP_ParticipantResult res = new GP_ParticipantResult(r.ParticipantId, result, PLACING_UNINITIALIZED);
            resultsList.Add(res);
        }

        GooglePlayTBM.Instance.FinishMatch(matchId, matchData, resultsList.ToArray());
    }
	//--------------------------------------
	// Public Methods
	//--------------------------------------

	public void SetResult(GP_ParticipantResult r) {
		_result = r;
	}
 public void SetResult(GP_ParticipantResult r)
 {
     _result = r;
 }