示例#1
0
 public Metric (KnetikClient client, Game game, string name)
     : base(client)
 {
     ID = -1;
     Game = game;
     Name = name;
 }
示例#2
0
 public UserOption (KnetikClient client, Game game)
     : base(client, game)
 {
 }
示例#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;
        }
示例#4
0
 public Option (KnetikClient client, Game game)
     : base(client)
 {
     Game = game;
     ID = -1;
 }
示例#5
0
 public ValueMetric (KnetikClient client, Game game, string name)
 : base(client, game, name)
 {
 }
示例#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;
 }
示例#7
0
 public ObjectMetric(KnetikClient client, Game game, string name)
     : base(client, game, name)
 {
 }