public bool HasFlag(ComponentFlag flag) { if (flag.GetHashCode() == 0) { return(false); } return((this.SystemLowFlag & flag.SystemLowFlag) == flag.SystemLowFlag && (this.SystemHighFlag & flag.SystemHighFlag) == flag.SystemHighFlag && (this.PlayerLowFlag & flag.PlayerLowFlag) == flag.PlayerLowFlag && (this.PlayerHighFlag & flag.PlayerHighFlag) == flag.PlayerHighFlag); }
public Group(params Int64[] array) { _componentFlag = new ComponentFlag(); if (array != null) { for (int i = 0; i < array.Length; i++) { ComponentFlag.SetFlag(array[i]); } } _hashCode = _componentFlag.GetHashCode(); _entityHashSet = new HashSet <Entity>(); }
public Group MatchGetGroup(ComponentFlag flag) { foreach (Group item in _matchGroupHashSet) { if (item.GetHashCode() == flag.GetHashCode()) { return(item); } } Group group = new Group(flag); _matchGroupHashSet.Add(group); return(group); }
public Group(ComponentFlag flag) { _componentFlag = flag; _hashCode = _componentFlag.GetHashCode(); _entityHashSet = new HashSet <Entity>(); }