Ejemplo n.º 1
0
        public static HighScore FromJson(string raw)
        {
            JSONNode      json    = JSON.Parse(raw);
            ArcadeMachine machine = ArcadeMachine.FromJson(json["arcade_machine"]);

            return(new HighScore(json["name"], json["score"].AsInt, machine));
        }
Ejemplo n.º 2
0
        public static HighScore[] ListFromJson(string raw)
        {
            JSONArray json = JSON.Parse(raw)["high_scores"].AsArray;

            HighScore[] scores = new HighScore[json.Count];

            for (int i = 0; i < json.Count; i++)
            {
                ArcadeMachine machine = ArcadeMachine.FromJson(json[i]["arcade_machine"]);
                scores[i] = new HighScore(json[i]["name"], json[i]["score"].AsInt, machine);
            }

            return(scores);
        }
Ejemplo n.º 3
0
 public HighScore(string name, int score, ArcadeMachine machine = null)
 {
     Name      = name;
     Score     = score;
     Winnitron = machine;
 }