~ruther/NosTale-Gfless

ref: 0433b5040dabe05c55139c75fbd63edac106b9ab NosTale-Gfless/NostaleAuth/Models/GameforgeAccount.cs -rw-r--r-- 564 bytes
0433b504 — František Boháček fix: close application for not parsed arguments 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System;
using Newtonsoft.Json;

namespace NostaleAuth.Models
{
    public sealed class GameforgeAccount
    {
        public string Id { get; set; }

        [JsonProperty("displayName")]
        public string Name { get; set; }

        [JsonProperty("accountGroup")]
        public string Region { get; set; }

        public override string ToString() => $"{nameof(Id)}: {Id}, {nameof(Name)}: {Name}";

        public RegionType GetRegionType()
        {
            return (RegionType) Enum.Parse(typeof(RegionType), Region.ToUpper());
        }
    }
}