Lua向C#逻辑迁移 一期 #13

将整个插件代码上传
This commit is contained in:
2025-10-26 21:48:39 +08:00
parent 56994b3927
commit 648386cd73
785 changed files with 53683 additions and 2 deletions

View File

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace UnrealSharpScriptGenerator.Model;
public record struct SpecialStructInfo
{
public HashSet<string> SkippedTypes { get; init; }
public Dictionary<string, BlittableStructInfo> BlittableTypes { get; init; }
public Dictionary<string, NativelyTranslatableStructInfo> NativelyCopyableTypes { get; init; }
public bool Equals(SpecialStructInfo other)
{
if (BlittableTypes.Count != other.BlittableTypes.Count || NativelyCopyableTypes.Count != other.NativelyCopyableTypes.Count)
{
return false;
}
foreach (var (key, value) in BlittableTypes)
{
if (!other.BlittableTypes.TryGetValue(key, out var otherValue) || value != otherValue)
{
return false;
}
}
foreach (var (key, value) in NativelyCopyableTypes)
{
if (!other.NativelyCopyableTypes.TryGetValue(key, out var otherValue) || value != otherValue)
{
return false;
}
}
return true;
}
public override int GetHashCode()
{
return HashCode.Combine(BlittableTypes, NativelyCopyableTypes);
}
}
public record SpecialTypeInfo
{
public SpecialStructInfo Structs { get; init; } = new()
{
SkippedTypes = [],
BlittableTypes = new Dictionary<string, BlittableStructInfo>(),
NativelyCopyableTypes = new Dictionary<string, NativelyTranslatableStructInfo>()
};
public virtual bool Equals(SpecialTypeInfo? other)
{
return other is not null && Structs.Equals(other.Structs);
}
public override int GetHashCode()
{
return HashCode.Combine(Structs);
}
}

View File

@ -0,0 +1,19 @@
using System.Collections.Immutable;
namespace UnrealSharpScriptGenerator.Model;
public record struct BlittableStructInfo(string Name, string? ManagedType = null);
public record struct NativelyTranslatableStructInfo(string Name, bool HasDestructor);
public struct StructTranslationInfo()
{
public ImmutableArray<string> CustomTypes { get; init; } = [];
public ImmutableArray<BlittableStructInfo> BlittableTypes { get; init; } = [];
public ImmutableArray<NativelyTranslatableStructInfo> NativelyTranslatableTypes { get; init; } = [];
}
public record TypeTranslationManifest
{
public StructTranslationInfo Structs { get; init; }
}