port(m1): wave 7j — Material/Plane/Socket overloads + IDictionary extension (24->12)
- Material.SetVector(int nameID, Vector4); Plane(Vector3, float d) ctor; Socket.On (SocketIOEventTypes, callback) overload. - Global GetValueOrDefault(this IDictionary<,>) extension — the BCL form only binds to IReadOnlyDictionary, so the IDictionary call mis-resolved to JsonDataExtension. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
10
SVSim.BattleEngine/Shim/External/SdkStubs.cs
vendored
10
SVSim.BattleEngine/Shim/External/SdkStubs.cs
vendored
@@ -99,3 +99,13 @@ namespace BestHTTP.Decompression.Zlib
|
||||
public static class TimeNativePlugin { public static float GetDeviceOperatingTime() => 0f; }
|
||||
public static class Packsize { public static bool Test() => true; }
|
||||
public static class DllCheck { public static bool Test() => true; }
|
||||
|
||||
// The BCL's CollectionExtensions.GetValueOrDefault only binds to IReadOnlyDictionary;
|
||||
// copied code calls it on an IDictionary<,> static type (where the only by-name match is
|
||||
// the copied JsonDataExtension.GetValueOrDefault(JsonData,...) — wrong receiver). Supply the
|
||||
// IDictionary form globally so the call resolves.
|
||||
public static class ShimDictionaryExtensions
|
||||
{
|
||||
public static TValue GetValueOrDefault<TKey, TValue>(this System.Collections.Generic.IDictionary<TKey, TValue> dict, TKey key, TValue defaultValue)
|
||||
=> dict != null && dict.TryGetValue(key, out var v) ? v : defaultValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user