Skip to content

Commit

Permalink
Fix attributes of th17 chara-related enums
Browse files Browse the repository at this point in the history
  • Loading branch information
y-iihoshi committed Jan 5, 2025
1 parent 2f7b130 commit 87f071e
Show file tree
Hide file tree
Showing 7 changed files with 336 additions and 49 deletions.
35 changes: 9 additions & 26 deletions TemplateGenerator/Models/Th17/Definitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,15 @@ public class Definitions : Models.Definitions
{
public static string Title { get; } = StringResources.TH17;

public static IReadOnlyDictionary<string, string> CharacterNames { get; } = new[]
{
(Chara.ReimuA, "博麗 霊夢 (狼)"),
(Chara.ReimuB, "博麗 霊夢 (獺)"),
(Chara.ReimuC, "博麗 霊夢 (鷲)"),
(Chara.MarisaA, "霧雨 魔理沙 (狼)"),
(Chara.MarisaB, "霧雨 魔理沙 (獺)"),
(Chara.MarisaC, "霧雨 魔理沙 (鷲)"),
(Chara.YoumuA, "魂魄 妖夢 (狼)"),
(Chara.YoumuB, "魂魄 妖夢 (獺)"),
(Chara.YoumuC, "魂魄 妖夢 (鷲)"),
}.ToStringKeyedDictionary();

public static IReadOnlyDictionary<string, string> CharacterWithTotalNames { get; } = new[]
{
(CharaWithTotal.ReimuA, "博麗 霊夢 (狼)"),
(CharaWithTotal.ReimuB, "博麗 霊夢 (獺)"),
(CharaWithTotal.ReimuC, "博麗 霊夢 (鷲)"),
(CharaWithTotal.MarisaA, "霧雨 魔理沙 (狼)"),
(CharaWithTotal.MarisaB, "霧雨 魔理沙 (獺)"),
(CharaWithTotal.MarisaC, "霧雨 魔理沙 (鷲)"),
(CharaWithTotal.YoumuA, "魂魄 妖夢 (狼)"),
(CharaWithTotal.YoumuB, "魂魄 妖夢 (獺)"),
(CharaWithTotal.YoumuC, "魂魄 妖夢 (鷲)"),
(CharaWithTotal.Total, "全主人公合計"),
}.ToStringKeyedDictionary();
public static IReadOnlyDictionary<string, string> CharacterNames { get; } =
EnumHelper<Chara>.Enumerable.ToDictionary(
static chara => chara.ToPattern(),
static chara => $"{chara.ToCharaFullName()} ({chara.ToShotTypeName()})");

public static IReadOnlyDictionary<string, string> CharacterWithTotalNames { get; } =
EnumHelper<CharaWithTotal>.Enumerable.ToDictionary(
static chara => chara.ToPattern(),
static chara => (chara == CharaWithTotal.Total) ? "全主人公合計" : $"{chara.ToCharaFullName()} ({chara.ToShotTypeName()})");

public static IEnumerable<string> CharacterKeysTotalFirst { get; } = CharacterWithTotalNames.Keys.RotateRight();

Expand Down
36 changes: 27 additions & 9 deletions ThScoreFileConverter.Core/Models/Th17/Chara.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,72 @@ public enum Chara
/// <summary>
/// Hakurei Reimu (Wolf spirit).
/// </summary>
[EnumAltName("RA")]
[Pattern("RA")]
[Character("Reimu")]
[ShotType<Chara>(ReimuA)]
ReimuA,

/// <summary>
/// Hakurei Reimu (Otter spirit).
/// </summary>
[EnumAltName("RB")]
[Pattern("RB")]
[Character("Reimu")]
[ShotType<Chara>(ReimuB)]
ReimuB,

/// <summary>
/// Hakurei Reimu (Eagle spirit).
/// </summary>
[EnumAltName("RC")]
[Pattern("RC")]
[Character("Reimu")]
[ShotType<Chara>(ReimuC)]
ReimuC,

/// <summary>
/// Kirisame Reimu (Wolf spirit).
/// </summary>
[EnumAltName("MA")]
[Pattern("MA")]
[Character("Marisa")]
[ShotType<Chara>(MarisaA)]
MarisaA,

/// <summary>
/// Kirisame Marisa (Otter spirit).
/// </summary>
[EnumAltName("MB")]
[Pattern("MB")]
[Character("Marisa")]
[ShotType<Chara>(MarisaB)]
MarisaB,

/// <summary>
/// Kirisame Marisa (Eagle spirit).
/// </summary>
[EnumAltName("MC")]
[Pattern("MC")]
[Character("Marisa")]
[ShotType<Chara>(MarisaC)]
MarisaC,

/// <summary>
/// Konpaku Youmu (Wolf spirit).
/// </summary>
[EnumAltName("YA")]
[Pattern("YA")]
[Character("Youmu")]
[ShotType<Chara>(YoumuA)]
YoumuA,

/// <summary>
/// Konpaku Youmu (Otter spirit).
/// </summary>
[EnumAltName("YB")]
[Pattern("YB")]
[Character("Youmu")]
[ShotType<Chara>(YoumuB)]
YoumuB,

/// <summary>
/// Konpaku Youmu (Eagle spirit).
/// </summary>
[EnumAltName("YC")]
[Pattern("YC")]
[Character("Youmu")]
[ShotType<Chara>(YoumuC)]
YoumuC,
}
38 changes: 28 additions & 10 deletions ThScoreFileConverter.Core/Models/Th17/CharaWithTotal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,78 @@ public enum CharaWithTotal
/// <summary>
/// Hakurei Reimu (Wolf spirit).
/// </summary>
[EnumAltName("RA")]
[Pattern("RA")]
[Character("Reimu")]
[ShotType<CharaWithTotal>(ReimuA)]
ReimuA,

/// <summary>
/// Hakurei Reimu (Otter spirit).
/// </summary>
[EnumAltName("RB")]
[Pattern("RB")]
[Character("Reimu")]
[ShotType<CharaWithTotal>(ReimuB)]
ReimuB,

/// <summary>
/// Hakurei Reimu (Eagle spirit).
/// </summary>
[EnumAltName("RC")]
[Pattern("RC")]
[Character("Reimu")]
[ShotType<CharaWithTotal>(ReimuC)]
ReimuC,

/// <summary>
/// Kirisame Reimu (Wolf spirit).
/// </summary>
[EnumAltName("MA")]
[Pattern("MA")]
[Character("Marisa")]
[ShotType<CharaWithTotal>(MarisaA)]
MarisaA,

/// <summary>
/// Kirisame Marisa (Otter spirit).
/// </summary>
[EnumAltName("MB")]
[Pattern("MB")]
[Character("Marisa")]
[ShotType<CharaWithTotal>(MarisaB)]
MarisaB,

/// <summary>
/// Kirisame Marisa (Eagle spirit).
/// </summary>
[EnumAltName("MC")]
[Pattern("MC")]
[Character("Marisa")]
[ShotType<CharaWithTotal>(MarisaC)]
MarisaC,

/// <summary>
/// Konpaku Youmu (Wolf spirit).
/// </summary>
[EnumAltName("YA")]
[Pattern("YA")]
[Character("Youmu")]
[ShotType<CharaWithTotal>(YoumuA)]
YoumuA,

/// <summary>
/// Konpaku Youmu (Otter spirit).
/// </summary>
[EnumAltName("YB")]
[Pattern("YB")]
[Character("Youmu")]
[ShotType<CharaWithTotal>(YoumuB)]
YoumuB,

/// <summary>
/// Konpaku Youmu (Eagle spirit).
/// </summary>
[EnumAltName("YC")]
[Pattern("YC")]
[Character("Youmu")]
[ShotType<CharaWithTotal>(YoumuC)]
YoumuC,

/// <summary>
/// Represents total across characters.
/// </summary>
[EnumAltName("TL")]
[Pattern("TL")]
Total,
}
162 changes: 162 additions & 0 deletions ThScoreFileConverter.Core/Resources/ShotTypeNames.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 87f071e

Please sign in to comment.