Пример #1
0
        public static void FetchSolSysById(long solSysId, SolSysObj_callback callback)
        {
            string      fullURL = "solsys";
            RestRequest request = new RestRequest(fullURL, Method.GET);

            request.AddParameter("solsysid", solSysId);
            apiClient.ExecuteAsync(request, (response) =>
            {
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    SolSysObj newObj = response.Content.FromJson <SolSysObj>();
                    callback(newObj);
                }
                else
                {
                    callback(null);
                }
            });
        }
Пример #2
0
        public static void FetchSolSys(int xLoc, int yLoc, int zLoc, SolSysObj_callback callback)
        {
            string      fullURL = "solsys";
            RestRequest request = new RestRequest(fullURL, Method.GET);

            request.AddParameter("xloc", xLoc);
            request.AddParameter("yloc", yLoc);
            request.AddParameter("zloc", zLoc);

            apiClient.ExecuteAsync(request, (response) =>
            {
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    SolSysObj newObj = response.Content.FromJson <SolSysObj>();
                    callback(newObj);
                }
                else
                {
                    callback(null);
                }
            });
        }
        public void InitializeSolSys(SolSysObj_callback callback)
        {
            if (pop.structureId == 0)
            {
                InitializeNewPop((theSys) =>
                {
                    pop.curSolSys = theSys;
                    EnableBtn(solSysBtn);
                    callback(theSys);
                });
            }
            else
            {
                // laoad it from the structure

                /*
                 * PhabrikServer.FetchSolSysFromStructure(pop.structureId, (theSys) =>
                 * {
                 *  pop.curSolSys = theSys;
                 *  callback(theSys);
                 * });
                 */
            }
        }
 public void InitializeNewPop(SolSysObj_callback callback)
 {
     // for now, just use an empty system
     PhabrikServer.FetchSolSys(0, 0, 0, callback);
 }