NG_/Assets/Scripts/Data/Entity/SituationEventData.cs

30 lines
1009 B
C#
Raw Normal View History

2024-12-13 19:40:05 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class SituationEventData:IEquatable<SituationEventData>
{
public string nickName;
public List<string> postDept;
public List<string> researches;
public string createTime;
// 实现IEquatable接口的Equals方法以及重写GetHashCode方法以及ToString方法
public bool Equals(SituationEventData other)
{
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;
return nickName == other.nickName && postDept == other.postDept && researches == other.researches && createTime == other.createTime;
}
public override int GetHashCode()
{
return HashCode.Combine(nickName, postDept, researches, createTime);
}
public override string ToString()
{
return $"昵称: {nickName} 岗位部门: {postDept} 课题组: {researches} 创建时间: {createTime}";
}
}