r2mods/ilspy_dump/ror2_csproj/RoR2/UserVote.cs

35 lines
746 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using System;
using System.Collections.Generic;
using UnityEngine;
namespace RoR2;
[Serializable]
public struct UserVote : IEquatable<UserVote>
{
public GameObject networkUserObject;
public int voteChoiceIndex;
public bool receivedVote => voteChoiceIndex >= 0;
public bool Equals(UserVote other)
{
if (other.networkUserObject.Equals(networkUserObject))
{
return other.voteChoiceIndex.Equals(voteChoiceIndex);
}
return false;
}
public override bool Equals(object obj)
{
return (obj as UserVote?)?.Equals(this) ?? false;
}
public override int GetHashCode()
{
return (-555733029 * -1521134295 + EqualityComparer<GameObject>.Default.GetHashCode(networkUserObject)) * -1521134295 + voteChoiceIndex.GetHashCode();
}
}