Пример #1
0
 public SmashggImage(JToken v)
 {
     this.id     = SmashggConversion.ToInt((string)v["id"]);
     this.height = SmashggConversion.ToFloat((string)v["height"]);
     this.ratio  = SmashggConversion.ToFloat((string)v["ratio"]);
     this.width  = SmashggConversion.ToFloat((string)v["width"]);
     this.type   = (string)v["type"];
     this.url    = (string)v["url"];
 }
Пример #2
0
        public Event(JToken v)
        {
            //Ints
            this.id              = SmashggConversion.ToInt((string)v["id"]);
            this.checkInBuffer   = SmashggConversion.ToInt((string)v["checkInBuffer"]);
            this.checkInDuration = SmashggConversion.ToInt((string)v["checkInDuration"]);
            this.entrantSizeMax  = SmashggConversion.ToInt((string)v["entrantSizeMax"]);
            this.entrantSizeMin  = SmashggConversion.ToInt((string)v["entrantSizeMin"]);
            this.numEntrants     = SmashggConversion.ToInt((string)v["numEntrants"]);
            this.rulesetId       = SmashggConversion.ToInt((string)v["rulesetId"]);



            //Bools
            this.checkInEnabled = bool.Parse((string)v["checkInEnabled"]);
            this.hasDecks       = bool.Parse((string)v["hasDecks"]);
            this.hasTasks       = bool.Parse((string)v["hasTasks"]);
            this.isOnline       = bool.Parse((string)v["isOnline"]);
            this.useEventSeeds  = (string)v["useEventSeeds"] == null ? false : bool.Parse((string)v["useEventSeeds"]);

            //Strings
            this.name = (string)v["name"];
            this.matchRulesMarkdown = (string)v["matchRulesMarkdown"];
            this.rulesMarkdown      = (string)v["rulesMarkdown"];
            this.slug = (string)v["slug"];



            //DateTime
            this.createdAt = SmashggConversion.UnixTimeStampToDateTime((string)v["createdAt"]);
            this.deckSubmissionDeadline = SmashggConversion.UnixTimeStampToDateTime((string)v["deckSubmissionDeadline"]);
            this.startAt = SmashggConversion.UnixTimeStampToDateTime((string)v["startAt"]);
            this.teamManagementDeadline = SmashggConversion.UnixTimeStampToDateTime((string)v["teamManagementDeadline"]);

            //JOSN
            this.prizingInfo = v["prizingInfo"];
            this.publishing  = v["publishing"];

            //Objects
            this.images = SmashggImage.ParseImages(v["images"]);
        }
Пример #3
0
        public Streams(JToken v)
        {
            //Ints
            this.id             = SmashggConversion.ToInt((string)v["id"]);
            this.followerCount  = SmashggConversion.ToInt((string)v["followerCount"]);
            this.numSetups      = SmashggConversion.ToInt((string)v["numSetups"]);
            this.parentStreamId = SmashggConversion.ToInt((string)v["parentStreamId"]);
            this.streamType     = SmashggConversion.ToInt((string)v["streamType"]);
            this.streamTypeId   = SmashggConversion.ToInt((string)v["streamTypeId"]);

            //Bools
            this.enabled  = bool.Parse((string)v["enabled"]);
            this.isOnline = bool.Parse((string)v["isOnline"]);

            //Strings
            this.streamGame   = (string)v["streamGame"];
            this.streamId     = (string)v["streamId"];
            this.streamLogo   = (string)v["streamLogo"];
            this.streamName   = (string)v["streamName"];
            this.streamSource = (string)v["streamSource"];
            this.streamStatus = (string)v["streamStatus"];
        }
Пример #4
0
        public Tournament(string response)
        {
            JObject obj        = JObject.Parse(response);
            JObject tournament = JObject.Parse(obj["data"]["tournament"].ToString());

            //Ints
            this.id             = SmashggConversion.ToInt((string)tournament["id"]);
            this.numAttendess   = SmashggConversion.ToInt((string)tournament["numAttendess"]);
            this.tournamentType = SmashggConversion.ToInt((string)tournament["tournamentType"]);
            this.state          = SmashggConversion.ToInt((string)tournament["state"]);

            //Strings
            this.name               = (string)tournament["name"];
            this.addrState          = (string)tournament["addrState"];
            this.city               = (string)tournament["city"];
            this.countryCode        = (string)tournament["countryCode"];
            this.currency           = (string)tournament["currency"];
            this.hashtag            = (string)tournament["hashtag"];
            this.mapsPlaceId        = (string)tournament["mapsPlaceId"];
            this.postalCode         = (string)tournament["postalCode"];
            this.primaryContact     = (string)tournament["primaryContact"];
            this.primaryContactType = (string)tournament["primaryContactType"];
            this.venueName          = (string)tournament["venueName"];
            this.venueAddress       = (string)tournament["venueAddress"];
            this.rules              = (string)tournament["rules"];
            this.shortSlug          = (string)tournament["shortSlug"];
            this.slug               = (string)tournament["slug"];
            this.url = (string)tournament["url"];

            //DateTime
            this.createdAt = SmashggConversion.UnixTimeStampToDateTime((string)tournament["createdAt"]);
            this.eventRegistrationClosesAt = SmashggConversion.UnixTimeStampToDateTime((string)tournament["eventRegistrationClosesAt"]);
            this.registrationClosesAt      = SmashggConversion.UnixTimeStampToDateTime((string)tournament["registrationClosesAt"]);
            this.startAt              = SmashggConversion.UnixTimeStampToDateTime((string)tournament["startAt"]);
            this.endDat               = SmashggConversion.UnixTimeStampToDateTime((string)tournament["endDat"]);
            this.updatedAt            = SmashggConversion.UnixTimeStampToDateTime((string)tournament["updatedAt"]);
            this.teamCreationClosesAt = SmashggConversion.UnixTimeStampToDateTime((string)tournament["teamCreationClosesAt"]);

            //Floats
            this.lat = SmashggConversion.ToFloat((string)tournament["lat"]);
            this.lng = SmashggConversion.ToFloat((string)tournament["lng"]);

            //Bools
            this.hasOnlineEvents = bool.Parse((string)tournament["hasOnlineEvents"]);
            this.isOnline        = bool.Parse((string)tournament["isOnline"]);

            //JSON
            this.publishing = tournament["publishing"];

            //Objects
            this.streams = Streams.ParseStreams(tournament["streams"]);
            this.events  = Event.ParseEvents(tournament["events"]);
            this.images  = SmashggImage.ParseImages(tournament["images"]);
            this.links   = new TournamentLinks(tournament["links"]);

            Console.Write("");
            //this.owner = tournament[""];
            //this.participants = tournament[""].ToString();
            //this.stations = tournament[""].ToString();
            //this.streamQueue = tournament[""].ToString();

            //this.timezone = tournament[""].ToString();
            //this.url = tournament[""].ToString();
            //this.waves = tournament[""].ToString();
        }