Skip to content

Commit

Permalink
Update Counter.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Caisusandy committed Sep 9, 2024
1 parent e726f08 commit 0decc01
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Counter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down Expand Up @@ -184,5 +191,12 @@ public T[] Items
c.Remove(obj);
return c;
}

public static bool operator >(Counter<T> c, int count) => c.Count > count;
public static bool operator <(Counter<T> c, int count) => c.Count < count;
public static bool operator ==(Counter<T> c, int count) => c.Count == count;
public static bool operator !=(Counter<T> c, int count) => !(c == count);
public static bool operator >=(Counter<T> c, int count) => !(c < count);
public static bool operator <=(Counter<T> c, int count) => !(c > count);
}
}

0 comments on commit 0decc01

Please sign in to comment.