Example #1
0
 public Metric (KnetikClient client, Game game, string name)
     : base(client)
 {
     ID = -1;
     Game = game;
     Name = name;
 }
Example #2
0
 public UserOption (KnetikClient client, Game game)
     : base(client, game)
 {
 }
Example #3
0
        private KnetikResult<Game> OnLoadWithGame(KnetikApiResponse res)
        {
            var result = new KnetikResult<Game> {
                Response = res
            };
            if (!res.IsSuccess) {
                return result;
            }
            Response = res;

            if (res.Body["result"]["product_item"].AsObject == null) {
                result.Response.Status = KnetikApiResponse.StatusType.Error;
                result.Response.ErrorMessage = "Item not found";
                return result;
            }

            Game game = new Game(Client);
            result.Value = game;
            this.Deserialize(res.Body["result"]);
            game.Deserialize(res.Body["result"]["product_item"]);
            return result;
        }
Example #4
0
 public Option (KnetikClient client, Game game)
     : base(client)
 {
     Game = game;
     ID = -1;
 }
Example #5
0
 public ValueMetric (KnetikClient client, Game game, string name)
 : base(client, game, name)
 {
 }
Example #6
0
 public static Item Parse(KnetikClient client, KnetikJSONNode json)
 {
     string typeHint = json["type_hint"];
     Item item;
     switch (typeHint) {
         case "game":
         item = new Game(client);
         break;
         case "physical_item":
         item = new PhysicalItem(client);
         break;
         case "virtual_item":
         item = new VirtualItem(client);
         break;
         case "entitlement":
         item = new Entitlement(client);
         break;
         case "subscription":
         item = new Subscription(client);
         break;
         case "achievement_item":
         item = new Achievement(client);
         break;
         case "leaderboard":
         item = new Leaderboard(client);
         break;
         default:
         item = new Item(client);
         break;
     }
     item.Deserialize(json);
     return item;
 }
Example #7
0
 public ObjectMetric(KnetikClient client, Game game, string name)
     : base(client, game, name)
 {
 }