コード例 #1
0
ファイル: Table.cs プロジェクト: ttesla/gj-unity-api
		protected override void PopulateFromJSON(JSONClass data)
		{
			this.ID = data["id"].AsInt;
			this.Name = data["name"].Value;
			this.Description = data["description"].Value;
			this.Primary = data["primary"].Value == "1";
		}
コード例 #2
0
ファイル: Score.cs プロジェクト: ttesla/gj-unity-api
		protected override void PopulateFromJSON(JSONClass data)
		{
			this.Value = data["sort"].AsInt;
			this.Text = data["score"].Value;
			this.Extra = data["extra_data"].Value;
			this.Time = data["stored"].Value;

			this.UserID = data["user_id"].AsInt;
			this.UserName = data["user"].Value;
			this.GuestName = data["guest"].Value;
		}
コード例 #3
0
ファイル: Trophy.cs プロジェクト: ttesla/gj-unity-api
		protected override void PopulateFromJSON(JSONClass data)
		{
			this.ID = data["id"].AsInt;
			this.Title = data["title"].Value;
			this.Description = data["description"].Value;
			this.ImageURL = data["image_url"].Value;
			this.Unlocked = data["achieved"].Value != "false";

			try
			{
				this.Difficulty = (TrophyDifficulty)Enum.Parse(typeof(TrophyDifficulty), data["difficulty"].Value);
			}
			catch
			{
				this.Difficulty = TrophyDifficulty.Undefined;
			}
		}
コード例 #4
0
ファイル: User.cs プロジェクト: ttesla/gj-unity-api
		protected override void PopulateFromJSON(JSONClass data)
		{
			this.Name = data["username"].Value;
			this.ID = data["id"].AsInt;
			this.AvatarURL = data["avatar_url"].Value;
			
			try
			{
				this.Type = (UserType)Enum.Parse(typeof(UserType), data["type"].Value);
			}
			catch
			{
				this.Type = UserType.Undefined;
			}

			try
			{
				this.Status = (UserStatus)Enum.Parse(typeof(UserStatus), data["status"].Value);
			}
			catch
			{
				this.Status = UserStatus.Undefined;
			}
		}
コード例 #5
0
ファイル: Trophy.cs プロジェクト: ttesla/gj-unity-api
		public Trophy(JSONClass data)
		{
			this.PopulateFromJSON(data);
		}
コード例 #6
0
ファイル: Score.cs プロジェクト: ttesla/gj-unity-api
		public Score(JSONClass data)
		{
			this.PopulateFromJSON(data);
		}
コード例 #7
0
ファイル: User.cs プロジェクト: Celcius/RocketSubs
 public User(JSONClass data)
     : base()
 {
     this.IsAuthenticated = false;
     this.PopulateFromJSON(data);
 }
コード例 #8
0
ファイル: Table.cs プロジェクト: ttesla/gj-unity-api
		public Table(JSONClass data)
		{
			this.PopulateFromJSON(data);
		}
コード例 #9
0
ファイル: Base.cs プロジェクト: ttesla/gj-unity-api
		public void BulkUpdate(JSONClass data)
		{
			PopulateFromJSON(data);
		}
コード例 #10
0
ファイル: Base.cs プロジェクト: ttesla/gj-unity-api
		protected abstract void PopulateFromJSON(JSONClass data);
コード例 #11
0
ファイル: SimpleJSON.cs プロジェクト: ttesla/gj-unity-api
 public override void Add (string aKey, JSONNode aItem)
 {
     var tmp = new JSONClass();
     tmp.Add(aKey, aItem);
     Set(tmp);
 }
コード例 #12
0
ファイル: SimpleJSON.cs プロジェクト: ttesla/gj-unity-api
 public override JSONNode this[string aKey]
 {
     get
     {
         return new JSONLazyCreator(this, aKey);
     }
     set
     {
         var tmp = new JSONClass();
         tmp.Add(aKey, value);
         Set(tmp);
     }
 }