From 0decc01728fdc2fdfadc5f0a69e3ed64a2deea40 Mon Sep 17 00:00:00 2001 From: Chad-Vine-Doll <164040662@qq.com> Date: Mon, 9 Sep 2024 13:56:01 -0500 Subject: [PATCH] Update Counter.cs --- Counter.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Counter.cs b/Counter.cs index a20f28d..3bbaf7f 100644 --- a/Counter.cs +++ b/Counter.cs @@ -94,6 +94,13 @@ public void CopyTo(UnityObject[] array, int arrayIndex) c.Remove(obj); return c; } + + public static bool operator >(Counter c, int count) => c.Count > count; + public static bool operator <(Counter c, int count) => c.Count < count; + public static bool operator ==(Counter c, int count) => c.Count == count; + public static bool operator !=(Counter c, int count) => !(c == count); + public static bool operator >=(Counter c, int count) => !(c < count); + public static bool operator <=(Counter c, int count) => !(c > count); } @@ -184,5 +191,12 @@ public T[] Items c.Remove(obj); return c; } + + public static bool operator >(Counter c, int count) => c.Count > count; + public static bool operator <(Counter c, int count) => c.Count < count; + public static bool operator ==(Counter c, int count) => c.Count == count; + public static bool operator !=(Counter c, int count) => !(c == count); + public static bool operator >=(Counter c, int count) => !(c < count); + public static bool operator <=(Counter c, int count) => !(c > count); } } \ No newline at end of file