mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 09:28:07 +08:00
* build: migrate C# formatting and add offscreen editor test support Host IMGUI tests on a detached panel without creating a native editor window. * feat(core): decode native battle records, geometry and animation metadata Read the two game variants’ battle tables and model data, with binary-reader and original-resource coverage. * feat(battle): implement deterministic combat rules and action settlement Implement actors, inventory, formation, action timing, status interruption, AI, stage ownership and deterministic replay. Keep the domain and its regression suite independent of Unity. * feat(battle): project native HUD state and input commands Add the presentation assembly and tests for command routing, lineup selection, floating numbers and stage messages. * feat(rendering): add battle lighting, actor appearance and native shadows Support baked and toon lighting, actor and weapon rendering, display refresh rate and resource ownership. * feat(effects): drive battle effects through shared resource previews Bind battle control nodes to action owners. Share preview lighting, geometry and effect resources with the existing Unity editors. * refactor(game): isolate story battle targeting and actor lifetimes Preserve scene ownership, bound story battle targeting and stop debug attacks when their actor leaves the scene. * feat(editor): compile original game data into battle scenarios Build per-variant animation and ability catalogs, encounter music, scene lighting profiles, random parties, equipment and test inventory from the original resources. * feat(editor): play battle sessions with animated previews and synced media Drive the preview scene, camera, effects, hit feedback, result choreography, music and movies from simulation snapshots and events. * feat(editor): add the battle workbench, native HUD and input controls Expose scenario authoring, replay, diagnostics, responsive command menus and mouse, touch and gamepad targeting. Include the editor workflow and HUD integration tests.
75 lines
3.1 KiB
C#
75 lines
3.1 KiB
C#
// ------------------------------------------------------------------------
|
|
// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved.
|
|
// See LICENSE file in the project root for license information.
|
|
// ------------------------------------------------------------------------
|
|
|
|
namespace Pal3.Tools.CodeStyle;
|
|
|
|
internal sealed record Options(bool Check, bool Verbose, bool All, string? Base, string[] Paths, bool Help)
|
|
{
|
|
internal const string Usage = """
|
|
Format owned C# changes with the pinned .NET SDK and StyleCop layout rules.
|
|
|
|
dotnet run --project tools/CodeStyle -- [--check] [--verbose] [--base REF | --all] [PATH ...]
|
|
|
|
--check Report required formatting without changing source files.
|
|
--base REF Include changes since the merge base of HEAD and this Git commit.
|
|
--all Format all owned C# files.
|
|
PATH Format whole files or folders under Assets/Scripts or Assets/Tests.
|
|
--verbose Show detailed Roslyn/MSBuild diagnostics.
|
|
--help Show this help.
|
|
|
|
With no selection flags, format current tracked/untracked C# changes.
|
|
Explicit paths cannot be combined with --base or --all.
|
|
Both PAL3 and PAL3A branches are formatted. Unity and game data are not required.
|
|
""";
|
|
|
|
internal static Options Parse(string[] arguments)
|
|
{
|
|
bool check = false, verbose = false, all = false, help = false, pathsOnly = false;
|
|
string? baseline = null;
|
|
var paths = new List<string>();
|
|
for (int index = 0; index < arguments.Length; index++)
|
|
{
|
|
string argument = arguments[index];
|
|
if (pathsOnly)
|
|
{
|
|
paths.Add(argument);
|
|
continue;
|
|
}
|
|
switch (argument)
|
|
{
|
|
case "--":
|
|
pathsOnly = true;
|
|
break;
|
|
case "--check":
|
|
check = true;
|
|
break;
|
|
case "--verbose":
|
|
verbose = true;
|
|
break;
|
|
case "--all":
|
|
all = true;
|
|
break;
|
|
case "--help" or "-h":
|
|
help = true;
|
|
break;
|
|
case "--base":
|
|
if (baseline != null || ++index >= arguments.Length ||
|
|
string.IsNullOrWhiteSpace(arguments[index]) || arguments[index].StartsWith('-'))
|
|
throw new ArgumentException("--base requires one Git commit.");
|
|
baseline = arguments[index];
|
|
break;
|
|
default:
|
|
if (argument.StartsWith("-", StringComparison.Ordinal))
|
|
throw new ArgumentException("Unknown option: " + argument);
|
|
paths.Add(argument);
|
|
break;
|
|
}
|
|
}
|
|
if ((all && baseline != null) || (paths.Count > 0 && (all || baseline != null)))
|
|
throw new ArgumentException("Explicit paths, --base and --all cannot be combined.");
|
|
return new(check, verbose, all, baseline, paths.ToArray(), help);
|
|
}
|
|
}
|