主题
GameData · 其他
FunctionBias 双端
命名空间 GameData.Enum
csharp
public enum FunctionBias枚举值
None— 在数据编辑器中选择函数时,显示服务器/客户端的共有函数,除非当前属性本身只存在于某一端。Server— 在数据编辑器中选择函数时,优先显示服务器端公式函数。 这表示公式默认可只在服务端赋值,不表示属性本身一定是服务端专属。Client— 在数据编辑器中选择函数时,优先显示客户端公式函数。 这表示公式默认可只在客户端赋值,不表示属性本身一定是客户端专属。
ExtensionMethods 双端
命名空间 GameData.Extension
csharp
public static class ExtensionMethods方法
GetHashCode 双端
csharp
public static int GetHashCode(this System.Enum en, bool deterministic)GetFullName 双端
csharp
public static string? GetFullName(this System.Enum en)GetHashCode 双端
csharp
public static int GetHashCode(this Type type, bool deterministic)GetFullNameWithGeneric 双端
csharp
public static string? GetFullNameWithGeneric(this Type type)GetHashCode 双端
csharp
public static uint GetHashCode(this string str, bool deterministic)GetHashCode 双端
csharp
public static uint GetHashCode(this ReadOnlySpan<byte> bytes, bool _)GetUrhoStringHash 双端
csharp
public static uint GetUrhoStringHash(this ReadOnlySpan<byte> utf8Bytes)计算 Urho3D StringHash 默认构造路径的 hash(SDBM 算法,按字节迭代,不做大小写转换)。 用于跨 wasm 边界匹配 native 端的 Resource::GetNameHash()、动画名 hash 等场景。
备注
与本文件中 Boolean) 的 deterministic 模式(DJB2 + UTF-16 字节)算法不同。 数编 ID 等走 DJB2 路径的场景请用 GetHashCode(deterministic: true), 资源路径 / 动画名等走 Urho 内置 StringHash 的场景用本方法。
GetUrhoStringHash 双端
csharp
public static uint GetUrhoStringHash(this string str)HashCodeDeterministic 双端
命名空间 GameData.Extension
csharp
public struct HashCodeDeterministic方法
Combine 双端
csharp
public static int Combine<T1>(T1 value1)Combine 双端
csharp
public static int Combine<T1, T2>(T1 value1, T2 value2)Combine 双端
csharp
public static int Combine<T1, T2, T3>(T1 value1, T2 value2, T3 value3)Combine 双端
csharp
public static int Combine<T1, T2, T3, T4>(T1 value1, T2 value2, T3 value3, T4 value4)Combine 双端
csharp
public static int Combine<T1, T2, T3, T4, T5>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)Combine 双端
csharp
public static int Combine<T1, T2, T3, T4, T5, T6>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6)Combine 双端
csharp
public static int Combine<T1, T2, T3, T4, T5, T6, T7>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7)Combine 双端
csharp
public static int Combine<T1, T2, T3, T4, T5, T6, T7, T8>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8)Add 双端
csharp
public void Add<T>(T value)Add 双端
csharp
public void Add<T>(T value, IEqualityComparer<T>? comparer)AddBytes 双端
csharp
public void AddBytes(ReadOnlySpan<byte> value)Adds a span of bytes to the hash code.
value— The span.
备注
This method does not guarantee that the result of adding a span of bytes will match the result of adding the same bytes individually.
ToHashCode 双端
csharp
public readonly int ToHashCode()IGameObject 双端
命名空间 GameData.Interface
csharp
public interface IGameObject<TData> : IGameObject where TData : IGameData<TData>属性
Link 双端
csharp
new IGameLink<TData> Link { get; }Cache 双端
csharp
new TData Cache { get; }