Rewrite to direct constructors

This commit is contained in:
2025-06-27 17:51:52 +03:00
parent 80490947b1
commit acb5a2cf58
13 changed files with 38 additions and 55 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ namespace mROA.Codegen
public sealed class RemoteTypeBinder
{
static RemoteTypeBinder(){
RemoteInstanceRepository.RemoteTypes = new Dictionary<Type, Type> {
RemoteInstanceRepository.RemoteTypeFactories = new Dictionary<Type, Func<int, IRepresentationModule, IEndPointContext, RemoteObjectBase>> {
<!I remoteTypePair r sep typesSep><!D typesSep>,
<!D>
};
+1 -1
View File
@@ -175,7 +175,7 @@ namespace mROA.Codegen
context.AddSource($"{className}.g.cs", SourceText.From(code, Encoding.UTF8));
#endif
_binderTemplate.Insert("remoteTypePair",
$"{{ typeof({classSymbol.ToUnityString()}), typeof({namespaceName}.{className}) }}");
$"{{ typeof({classSymbol.ToUnityString()}), (i, r, c) => new {namespaceName}.{className}(i, r, c) }}");
}
if (totalMethods.Count != 0)