Aetheria/Assets/Scripts/ServerShared/RuntimeProjection/RuntimeCatalogEntry.cs

57 lines
1.1 KiB
C#
Raw Normal View History

2026-06-13 04:56:50 +01:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
using System;
using Unity.Mathematics;
public interface INamedEntry
{
string EntryName { get; set; }
}
2026-06-13 17:22:03 +01:00
public abstract class RuntimeCatalogEntry
{
2020-05-14 02:47:07 +01:00
public Guid ID = Guid.NewGuid();
public override int GetHashCode()
{
return ID.GetHashCode();
}
public override bool Equals(object obj)
{
2026-06-13 17:22:03 +01:00
if (obj is RuntimeCatalogEntry entry) return entry.ID == ID;
return false;
}
}
2026-06-13 17:22:03 +01:00
public class RuntimeCatalogLink<T> : RuntimeCatalogLinkBase where T : ItemData
{
2026-06-13 17:38:05 +01:00
public T Value { get; private set; }
2026-06-13 17:38:05 +01:00
public RuntimeCatalogLink()
{
}
2026-06-13 17:38:05 +01:00
public RuntimeCatalogLink(T value)
{
2026-06-13 17:38:05 +01:00
SetValue(value);
}
2026-06-13 17:38:05 +01:00
public void SetValue(T value)
{
Value = value;
LinkID = value?.ID ?? Guid.Empty;
}
}
2026-06-13 17:38:05 +01:00
public class RuntimeCatalogLinkBase
{
public Guid LinkID;
}
public interface ITintInspector
{
float3 TintColor { get; }
}