Skip to content

Commit 20e2b6a

Browse files
author
Awbugl
committed
Initial Commit
1 parent 5a8129f commit 20e2b6a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2020
-0
lines changed

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.idea
2+
*.dll
3+
*.xml
4+
*.cache
5+
*.pdb
6+
*.txt
7+
*.nupkg
8+
*.p7s
9+
*._
10+
11+
[Dd]ebug/
12+
[Dd]ebugPublic/
13+
[Rr]elease/
14+
[Rr]eleases/
15+
x64/
16+
x86/
17+
bld/
18+
[Bb]in/
19+
[Oo]bj/
20+
[Ll]og/

Config.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator;
4+
5+
public class Config
6+
{
7+
[JsonProperty("iconpath")] public string IconPath { get; set; }
8+
[JsonProperty("songpath")] public string SongPath { get; set; }
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaLimitedApi;
4+
5+
[Serializable]
6+
public class Best30
7+
{
8+
[JsonProperty("data")] public List<RecordDataItem> Data { get; set; }
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaLimitedApi;
4+
5+
[Serializable]
6+
public class Partner
7+
{
8+
[JsonProperty("partner_id")] public int PartnerId { get; set; }
9+
[JsonProperty("is_awakened")] public bool IsAwakened { get; set; }
10+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaLimitedApi;
4+
5+
[Serializable]
6+
public class RecordDataItem
7+
{
8+
[JsonProperty("song_id")] public string SongId { get; set; }
9+
[JsonProperty("difficulty")] public sbyte Difficulty { get; set; }
10+
[JsonProperty("score")] public string Score { get; set; }
11+
[JsonProperty("shiny_pure_count")] public string ShinyPureCount { get; set; }
12+
[JsonProperty("pure_count")] public string PureCount { get; set; }
13+
[JsonProperty("far_count")] public string FarCount { get; set; }
14+
[JsonProperty("lost_count")] public string LostCount { get; set; }
15+
[JsonProperty("recollection_rate")] public int RecollectionRate { get; set; }
16+
[JsonProperty("time_played")] public long TimePlayed { get; set; }
17+
[JsonProperty("gauge_type")] public int GaugeType { get; set; }
18+
[JsonProperty("potential_value")] public double PotentialValue { get; set; }
19+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaLimitedApi;
4+
5+
[Serializable]
6+
public class ScoreinfoData
7+
{
8+
[JsonProperty("data")] public RecordDataItem Data { get; set; }
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaLimitedApi;
4+
5+
[Serializable]
6+
public class UserinfoData
7+
{
8+
[JsonProperty("data")] public UserinfoDataItem Data { get; set; }
9+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaLimitedApi;
4+
5+
[Serializable]
6+
public class UserinfoDataItem
7+
{
8+
[JsonProperty("display_name")] public string DisplayName { get; set; }
9+
[JsonProperty("potential")] public short? Potential { get; set; } = -1;
10+
[JsonProperty("partner")] public Partner Partner { get; set; }
11+
[JsonProperty("last_played_song")] public RecordDataItem LastPlayedSong { get; set; }
12+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaUnlimitedApi;
4+
5+
public class AccountInfo
6+
{
7+
[JsonProperty("code")] public int Code { get; set; }
8+
[JsonProperty("name")] public string Name { get; set; }
9+
[JsonProperty("user_id")] public int UserID { get; set; }
10+
[JsonProperty("is_mutual")] public bool IsMutual { get; set; }
11+
12+
[JsonProperty("is_char_uncapped_override")]
13+
public bool IsCharUncappedOverride { get; set; }
14+
15+
[JsonProperty("is_char_uncapped")] public bool IsCharUncapped { get; set; }
16+
[JsonProperty("is_skill_sealed")] public bool IsSkillSealed { get; set; }
17+
[JsonProperty("rating")] public short Rating { get; set; }
18+
[JsonProperty("character")] public int Character { get; set; }
19+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaUnlimitedApi;
4+
5+
public class ArcSongdata
6+
{
7+
[JsonProperty("song_id")] public string SongId { get; set; }
8+
9+
[JsonProperty("difficulty")] public sbyte Difficulty { get; set; }
10+
11+
[JsonProperty("score")] public string Score { get; set; }
12+
13+
[JsonProperty("shiny_perfect_count")] public string MaxPure { get; set; }
14+
15+
[JsonProperty("perfect_count")] public string Pure { get; set; }
16+
17+
[JsonProperty("near_count")] public string Far { get; set; }
18+
19+
[JsonProperty("miss_count")] public string Lost { get; set; }
20+
21+
[JsonProperty("time_played")] public long TimePlayed { get; set; }
22+
23+
[JsonProperty("clear_type")] public sbyte ClearType { get; set; }
24+
25+
[JsonProperty("rating")] public double Rating { get; set; }
26+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaUnlimitedApi;
4+
5+
public class ResponseRoot
6+
{
7+
[JsonProperty("content")] public dynamic Content { get; set; }
8+
9+
internal T? DeserializeContent<T>() => JsonConvert.DeserializeObject<T>(Content.ToString());
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using ImageGenerator.Data.Json.Arcaea.Songlist;
2+
using Newtonsoft.Json;
3+
4+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaUnlimitedApi;
5+
6+
public class SongListContent
7+
{
8+
[JsonProperty("songs")] public List<SongsItem> Songs { get; set; }
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaUnlimitedApi;
4+
5+
public class TooManySongsContent
6+
{
7+
[JsonProperty("songs")] public List<string> Songs { get; set; }
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaUnlimitedApi;
4+
5+
public class UserBest30Content
6+
{
7+
[JsonProperty("best30_avg")] public double Best30Avg { get; set; }
8+
[JsonProperty("recent10_avg")] public double Recent10Avg { get; set; }
9+
[JsonProperty("account_info")] public AccountInfo AccountInfo { get; set; }
10+
[JsonProperty("best30_list")] public List<ArcSongdata> Best30List { get; set; }
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaUnlimitedApi;
4+
5+
public class UserBestContent
6+
{
7+
[JsonProperty("account_info")] public AccountInfo AccountInfo { get; set; }
8+
[JsonProperty("record")] public ArcSongdata Record { get; set; }
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.ArcaeaUnlimitedApi;
4+
5+
public class UserInfoContent
6+
{
7+
[JsonProperty("account_info")] public AccountInfo AccountInfo { get; set; }
8+
[JsonProperty("recent_score")] public List<ArcSongdata> RecentScore { get; set; }
9+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System.Collections.Concurrent;
2+
using ImageGenerator.Model;
3+
using Newtonsoft.Json;
4+
5+
namespace ImageGenerator.Data.Json.Arcaea.PartnerPosInfoBase;
6+
7+
internal static class PartnerPosInfoBase
8+
{
9+
private static readonly Lazy<ConcurrentDictionary<string, List<PosInfoItem>>> Locations
10+
= new(() =>
11+
new(JsonConvert
12+
.DeserializeObject<
13+
Dictionary<string, List<PosInfoItem>>>(File.ReadAllText(Path.PartnerConfig))!));
14+
15+
private static readonly Lazy<ConcurrentDictionary<string, Dictionary<string, PosInfoItem>>> Dict
16+
= new(() => new(Init()));
17+
18+
private static readonly PosInfoItem ImgV1 = new() { PositionX = 770, PositionY = 58, Size = 950 };
19+
private static readonly PosInfoItem ImgV2 = new() { PositionX = 850, PositionY = 0, Size = 1400 };
20+
private static readonly PosInfoItem ImgV4 = new() { PositionX = 550, PositionY = 50, Size = 1500 };
21+
22+
private static Dictionary<string, Dictionary<string, PosInfoItem>> Init()
23+
{
24+
var ls = new Dictionary<string, Dictionary<string, PosInfoItem>>();
25+
foreach (var (key, value) in Locations.Value) ls.Add(key, value.ToDictionary(i => i.Partner));
26+
return ls;
27+
}
28+
29+
internal static PosInfoItem? Get(string partner, ImgVersion imgVersion)
30+
{
31+
return imgVersion switch
32+
{
33+
ImgVersion.ImgV1 => Dict.Value["1"].TryGetValue(partner, out var result)
34+
? result
35+
: ImgV1,
36+
ImgVersion.ImgV2 => Dict.Value["2"].TryGetValue(partner, out var result)
37+
? result
38+
: ImgV2,
39+
ImgVersion.ImgV4 => Dict.Value["4"].TryGetValue(partner, out var result)
40+
? result
41+
: ImgV4,
42+
_ => null
43+
};
44+
}
45+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace ImageGenerator.Data.Json.Arcaea.PartnerPosInfoBase;
2+
3+
public class PosInfoItem
4+
{
5+
public string Partner { get; set; }
6+
public int PositionX { get; set; }
7+
public int PositionY { get; set; }
8+
public int Size { get; set; }
9+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.Songlist;
4+
5+
[Serializable]
6+
public class DifficultiesItem
7+
{
8+
[JsonProperty("ratingClass")] public int RatingClass { get; set; }
9+
[JsonProperty("chartDesigner")] public string ChartDesigner { get; set; } = "";
10+
[JsonProperty("jacketDesigner")] public string JacketDesigner { get; set; } = "";
11+
12+
[JsonProperty("jacketOverride")] public bool JacketOverride { get; set; }
13+
14+
[JsonProperty("realrating")] public int RealRating { get; set; }
15+
[JsonProperty("totalNotes")] public int TotalNotes { get; set; }
16+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.Songlist;
4+
5+
#pragma warning disable CS8618
6+
7+
[Serializable]
8+
public class SongsItem
9+
{
10+
[JsonProperty("id")] public string Id { get; set; }
11+
12+
[JsonProperty("title_localized")] public TitleLocalized TitleLocalized { get; set; }
13+
14+
[JsonProperty("artist")] public string Artist { get; set; }
15+
16+
[JsonProperty("bpm")] public string Bpm { get; set; }
17+
18+
[JsonProperty("bpm_base")] public double BpmBase { get; set; }
19+
20+
[JsonProperty("set")] public string Set { get; set; }
21+
[JsonProperty("set_friendly")] public string? Package { get; set; }
22+
23+
[JsonProperty("world_unlock")] public bool WorldUnlock { get; set; }
24+
25+
[JsonProperty("remote_dl")] public bool NeedDownload { get; set; }
26+
27+
[JsonProperty("side")] public int Side { get; set; }
28+
29+
[JsonProperty("time")] public int Time { get; set; }
30+
31+
[JsonProperty("date")] public long Date { get; set; }
32+
33+
[JsonProperty("version")] public string Version { get; set; }
34+
35+
[JsonProperty("difficulties")] public List<DifficultiesItem> Difficulties { get; set; }
36+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Newtonsoft.Json;
2+
3+
namespace ImageGenerator.Data.Json.Arcaea.Songlist;
4+
5+
#pragma warning disable CS8618
6+
7+
[Serializable]
8+
public class TitleLocalized
9+
{
10+
[JsonProperty("en")] public string En { get; set; }
11+
12+
[JsonProperty("ja")] public string Ja { get; set; }
13+
}

ImageGenerator.csproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<AssemblyName>ImageGenerator</AssemblyName>
8+
<RootNamespace>ImageGenerator</RootNamespace>
9+
<OutputType>Exe</OutputType>
10+
</PropertyGroup>
11+
12+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
13+
<PlatformTarget>x86</PlatformTarget>
14+
<Prefer32bit>true</Prefer32bit>
15+
<DebugType>full</DebugType>
16+
</PropertyGroup>
17+
18+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19+
<PlatformTarget>x86</PlatformTarget>
20+
<Prefer32bit>true</Prefer32bit>
21+
</PropertyGroup>
22+
23+
<ItemGroup>
24+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
25+
<PackageReference Include="System.Drawing.Common" Version="5.0.3" />
26+
</ItemGroup>
27+
28+
</Project>

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Awbugl
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)