A game about forced loneliness, made by TACStudios
1// ==++==
2//
3// Copyright (c) Microsoft Corporation. All rights reserved.
4//
5// ==--==
6/*============================================================
7**
8** Interface: ISet
9**
10** <OWNER>kimhamil</OWNER>
11**
12**
13** Purpose: Base interface for all generic sets.
14**
15**
16===========================================================*/
17
18using System.Collections.Generic;
19
20namespace Unity.VisualScripting
21{
22 /// <summary>
23 /// Generic collection that guarantees the uniqueness of its elements, as defined
24 /// by some comparer. It also supports basic set operations such as Union, Intersection,
25 /// Complement and Exclusive Complement.
26 /// </summary>
27 public interface ISet<T> : ICollection<T>
28 {
29 //Add ITEM to the set, return true if added, false if duplicate
30 new bool Add(T item);
31
32 //Transform this set into its union with the IEnumerable<T> other
33 void UnionWith(IEnumerable<T> other);
34
35 //Transform this set into its intersection with the IEnumberable<T> other
36 void IntersectWith(IEnumerable<T> other);
37
38 //Transform this set so it contains no elements that are also in other
39 void ExceptWith(IEnumerable<T> other);
40
41 //Transform this set so it contains elements initially in this or in other, but not both
42 void SymmetricExceptWith(IEnumerable<T> other);
43
44 //Check if this set is a subset of other
45 bool IsSubsetOf(IEnumerable<T> other);
46
47 //Check if this set is a superset of other
48 bool IsSupersetOf(IEnumerable<T> other);
49
50 //Check if this set is a subset of other, but not the same as it
51 bool IsProperSupersetOf(IEnumerable<T> other);
52
53 //Check if this set is a superset of other, but not the same as it
54 bool IsProperSubsetOf(IEnumerable<T> other);
55
56 //Check if this set has any elements in common with other
57 bool Overlaps(IEnumerable<T> other);
58
59 //Check if this set contains the same and only the same elements as other
60 bool SetEquals(IEnumerable<T> other);
61 }
62}