This commit is contained in:
2026-04-25 23:37:10 +02:00
commit 19d6bd934a
476 changed files with 9198 additions and 0 deletions
@@ -0,0 +1,42 @@
using System;
using UnityEngine;
namespace RPGCore.GlobalModules.ProfileManagerGlobalModule
{
[Serializable]
public sealed class Profile<T> : Profile where T : class
{
public new T data
{
set => base.data = value;
get => base.data as T;
}
public Profile() : this(Environment.MachineName)
{
}
public Profile(string profileName)
{
name = profileName;
}
}
public abstract class Profile
{
private protected Profile()
{
}
public readonly string guid = Guid.NewGuid().ToString();
public readonly string version = Application.version;
public string name;
public object data;
public static bool operator ==(Profile obj1, Profile obj2) => obj1?.guid == obj2?.guid;
public static bool operator !=(Profile obj1, Profile obj2) => !(obj1 == obj2);
public override bool Equals(object obj) => obj is Profile other && guid == other.guid;
public override int GetHashCode() => guid.GetHashCode();
}
}