예제 #1
0
        // ---------[ MOD TEAMS ]---------
        public static void GetModTeam(int modId,
                                      Action <List <ModTeamMember> > onSuccess,
                                      Action <WebRequestError> onError)
        {
            List <ModTeamMember> cachedModTeam = CacheClient.LoadModTeam(modId);

            if (cachedModTeam != null)
            {
                if (onSuccess != null)
                {
                    onSuccess(cachedModTeam);
                }
            }
            else
            {
                // - Get All Team Members -
                Action <List <ModTeamMember> > onGetModTeam = (modTeam) =>
                {
                    CacheClient.SaveModTeam(modId, modTeam);
                    if (onSuccess != null)
                    {
                        onSuccess(modTeam);
                    }
                };

                ModManager.FetchAllResultsForQuery <ModTeamMember>((p, s, e) => APIClient.GetAllModTeamMembers(modId, RequestFilter.None,
                                                                                                               p, s, e),
                                                                   onGetModTeam,
                                                                   onError);
            }
        }