Beispiel #1
0
 public static void GetPopulationDensity(Action <PopulationDensityResponse> callback, Action <Exception> error)
 {
     Request <object> .Empty(PopulationMethod).Then(response =>
     {
         string json = "{\"density\":[39,12,54,43,123,95,19,33,78]}";
         callback.Invoke(JsonUtility.FromJson <PopulationDensityResponse>(json));
     }).Catch(error.Invoke);
 }
Beispiel #2
0
 public static void GetAll(Action <List <World> > callback, Action <Exception> error)
 {
     Request <object> .Empty(ListMethod).Then(response =>
     {
         WorldListResponse data = JsonUtility.FromJson <WorldListResponse>(response);
         List <World> worlds    = new List <World>();
         data.worlds.ForEach(worldResponse =>
         {
             worlds.Add(World.CreateFromDTO(worldResponse));
         });
         callback.Invoke(worlds);
     }).Catch(error.Invoke);
 }
Beispiel #3
0
 public static void SetPlayerHome(int id, Action <Exception> error)
 {
     Request <object> .Empty(SetHomeSystemId).Then(response => {}).Catch(error.Invoke);
 }