refactor: restructure interaction system into clean layers
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace Game.Shared.Domain;
|
||||
|
||||
public readonly record struct InstanceId(Guid Value)
|
||||
{
|
||||
private static Guid CreateDeterministicId(string source) =>
|
||||
new(MD5.HashData(Encoding.UTF8.GetBytes(source)));
|
||||
|
||||
public static InstanceId FromKey(string key) => new(CreateDeterministicId(key));
|
||||
|
||||
public override string ToString() => Value.ToString();
|
||||
}
|
||||
Reference in New Issue
Block a user