Skip to content

Commit 0318713

Browse files
committed
chore(generators): re-organise generated files
1 parent 0322548 commit 0318713

File tree

6 files changed

+8940
-8758
lines changed

6 files changed

+8940
-8758
lines changed

managed/CounterStrikeSharp.API/CounterStrikeSharp.API.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<PackageReference Include="Tomlyn" Version="0.19.0"/>
4848
</ItemGroup>
4949
<ItemGroup>
50-
<Folder Include="Core\Schema\"/>
50+
<Folder Include="Generated\Schema\" />
5151
<Folder Include="Modules\Errors"/>
5252
</ItemGroup>
5353
<ItemGroup>

managed/CounterStrikeSharp.SchemaGen/Program.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public static void Main(string[] args)
212212
{
213213
var outputPath =
214214
args.FirstOrDefault() ??
215-
"../CounterStrikeSharp.API/Core/Schema";
215+
"../CounterStrikeSharp.API/Generated/Schema";
216216

217217
// Concat together all enums and classes
218218
var allEnums = new SortedDictionary<string, SchemaEnum>();
@@ -407,20 +407,26 @@ private static void WriteClass(
407407
parentFields = GetAllParentFields(schemaClass, allClasses).ToArray();
408408
}
409409

410-
if (schemaClass.Parent == null)
410+
if (schemaClass.Parent == null && classNameCs != "CEntityInstance")
411411
{
412412
builder.Append($" : NativeObject");
413413
}
414+
else if (classNameCs == "CEntityInstance")
415+
{
416+
builder.Append($" : NativeEntity");
417+
}
414418

415419
builder.AppendLine();
416420
builder.AppendLine("{");
417421

418422
// All entity classes eventually derive from CEntityInstance,
419423
// which is the root networkable class.
420-
421-
builder.AppendLine(
422-
$" public {classNameCs} (IntPtr pointer) : base(pointer) {{}}");
423-
builder.AppendLine();
424+
if (classNameCs != "CEntityInstance")
425+
{
426+
builder.AppendLine(
427+
$" public {classNameCs} (IntPtr pointer) : base(pointer) {{}}");
428+
builder.AppendLine();
429+
}
424430

425431
foreach (var field in schemaClass.Fields)
426432
{

0 commit comments

Comments
 (0)