1
This commit is contained in:
28
Src/Unity/Scripts/MarkSystem/Core/IMarkSystem.cs
Normal file
28
Src/Unity/Scripts/MarkSystem/Core/IMarkSystem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITKit.MarkSystem
|
||||
{
|
||||
public interface IMarkObject
|
||||
{
|
||||
public int Id { get; }
|
||||
public Vector3 Position { get; }
|
||||
public object Object { get; }
|
||||
}
|
||||
public interface IMarkSystem
|
||||
{
|
||||
public void Register(IMarkObject markObject);
|
||||
public void UnRegister(IMarkObject markObject);
|
||||
}
|
||||
public class MarkObject : IMarkObject
|
||||
{
|
||||
public override bool Equals(object obj) => obj is MarkObject x && x.Id == Id;
|
||||
public override int GetHashCode() => Id.GetHashCode();
|
||||
private static int count;
|
||||
public int Id { get; } = count++;
|
||||
public Vector3 Position { get; set; }
|
||||
public object Object { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user