private void ActionMatchesDataLoadedFunction(GP_TBM_LoadMatchesResult result) { AndroidMessage.Create("Loaded all matches", "will show all matches"); bool loaded = false; List <GP_TBM_Match> matchDatas = new List <GP_TBM_Match>(); foreach (KeyValuePair <string, GP_TBM_Match> dict in result.LoadedMatches) { // AndroidMessage.Create("KEY VALUE PAIR ", "key "+dict.Key+" value mnumber"+dict.Value.MatchNumber.ToString()); if (loaded == false) { // DealWithMatchData(dict.Value); } loaded = true; matchDatas.Add(dict.Value); /* foreach (GP_Participant part in result.Match.Participants) * { * AndroidMessage.Create("Participant", "Participant info " + part.DisplayName + " +" + part.IconImageUrl + " id " + part.id + " pid " + part.playerId); * }*/ } matchDatasLoaded = matchDatas; // matchUI.SetActive(true); activeMatchesGridHandler.CreateMatches(matchDatas); }
void HandleActionMatchesResultLoaded(GP_TBM_LoadMatchesResult res) { _Matches.Clear(); if (res.IsSucceeded) { foreach (KeyValuePair <string, GP_TBM_Match> pair in res.LoadedMatches) { GP_TBM_Match match = pair.Value; UM_TBM_Match m = new UM_TBM_Match(match); UpdateMatchData(m); } } CheckDataCounter(); }
// -------------------------------------- // Native Events // -------------------------------------- private void OnLoadMatchesResult(string data) { string[] DataArray = data.Split(new string[] { AndroidNative.DATA_SPLITTER2 }, StringSplitOptions.None); GP_TBM_LoadMatchesResult result = new GP_TBM_LoadMatchesResult(DataArray[0]); if (DataArray.Length > 1) { result.LoadedMatches = new Dictionary <string, GP_TBM_Match>(); for (int i = 1; i < DataArray.Length; i++) { if (DataArray[i] == AndroidNative.DATA_EOF) { break; } GP_TBM_Match match = ParceMatchInfo(DataArray[i]); UpdateMatchInfo(match); result.LoadedMatches.Add(match.Id, match); } } ActionMatchesResultLoaded(result); }