예제 #1
0
파일: Gang.cs 프로젝트: dylanrenwick/GangOS
        public Gang(JToken json)
        {
            ID = json["id"].ToString();

            Name = json["name"].ToString();

            Birth = GangOSClient.ParseTime(json["createdAt"].ToString());

            Flag = GangOSClient.GetImageFromURL(json["flagUrl"].ToString(), Name, string.Format("{0}\\Gang_{1}_Flag.png", "GangFlags", Name), new Size(20, 14));

            GetMembers(json);

            switch (json["empire"].ToString())
            {
            case "Empire Alpha":
                Empire = "Alpha";
                break;

            case "Empire Beta":
                Empire = "Beta";
                break;

            default:
                Empire = String.Empty;
                break;
            }
        }
예제 #2
0
        public Player(JToken json, string auth)
        {
            Auth = auth;

            JToken JSON = json["account"];

            ID       = JSON["id"].ToString();
            Username = JSON["nickname"].ToString();

            DNA    = int.Parse(JSON["dna"].ToString());
            Medals = int.Parse(JSON["medal"].ToString());

            Birth     = GangOSClient.ParseTime(JSON["createdAt"].ToString());
            LastLogin = GangOSClient.ParseTime(JSON["updatedAt"].ToString());
        }