public GroupObserver(Group group, GroupEventType eventType) { _collectedEntities = new HashSet <Entity>(EntityEqualityComparer.comparer); _group = group; _eventType = eventType; Activate(); }
private void RegisterGroupEvent(SteamID chatRoomID, GroupEventType type) { // Similar to RegisterUserEvent if (groups.ContainsKey(chatRoomID)) { switch (type) { case GroupEventType.Invite: groups[chatRoomID].LastInvite = DateTime.Now; break; case GroupEventType.Joined: groups[chatRoomID].Joined = DateTime.Now; break; } } else { groups[chatRoomID] = new GroupCooldowns(); } var json = JsonConvert.SerializeObject(groups); File.WriteAllText("./groups.json", json); }
ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, TriggerOnEvent[] triggers) { _subsystem = subSystem; var ensureComponents = subSystem as IEnsureComponents; if (ensureComponents != null) { _ensureComponents = ensureComponents.ensureComponents; } var excludeComponents = subSystem as IExcludeComponents; if (excludeComponents != null) { _excludeComponents = excludeComponents.excludeComponents; } _clearAfterExecute = (subSystem as IClearReactiveSystem) != null; var triggersLength = triggers.Length; var groups = new Group[triggersLength]; var eventTypes = new GroupEventType[triggersLength]; for (int i = 0; i < triggersLength; i++) { var trigger = triggers[i]; groups[i] = pool.GetGroup(trigger.trigger); eventTypes[i] = trigger.eventType; } _observer = new GroupObserver(groups, eventTypes); _buffer = new List<Entity>(); }
public GroupObserver(Group group, GroupEventType eventType) { _collectedEntities = new HashSet<Entity>(EntityEqualityComparer.comparer); _group = group; _eventType = eventType; Activate(); }
ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, TriggerOnEvent[] triggers) { _subsystem = subSystem; var ensureComponents = subSystem as IEnsureComponents; if (ensureComponents != null) { _ensureComponents = ensureComponents.ensureComponents; } var excludeComponents = subSystem as IExcludeComponents; if (excludeComponents != null) { _excludeComponents = excludeComponents.excludeComponents; } _clearAfterExecute = (subSystem as IClearReactiveSystem) != null; var triggersLength = triggers.Length; var groups = new Group[triggersLength]; var eventTypes = new GroupEventType[triggersLength]; for (int i = 0; i < triggersLength; i++) { var trigger = triggers[i]; groups[i] = pool.GetGroup(trigger.trigger); eventTypes[i] = trigger.eventType; } _observer = new GroupObserver(groups, eventTypes); _buffer = new List <Entity>(); }
public MergeGroupEventArgs(IDocument doc, IRowsEnumerator rowEnumerator, GroupEventType eventType) { this.idocument_0 = doc; this.int_0 = rowEnumerator.CurrentRowIndex; this.int_1 = rowEnumerator.RowsCount; this.string_1 = rowEnumerator.TableName; this.groupEventType_0 = eventType; }
ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, IMatcher[] triggers, GroupEventType[] eventTypes) { _subsystem = subSystem; var groups = new Group[triggers.Length]; for (int i = 0, triggersLength = triggers.Length; i < triggersLength; i++) { groups[i] = pool.GetGroup(triggers[i]); } _observer = new GroupObserver(groups, eventTypes); _buffer = new List<Entity>(); }
public GroupObserver(Group[] groups, GroupEventType[] eventTypes) { if (groups.Length != eventTypes.Length) { throw new GroupObserverException("Unbalanced count with groups (" + groups.Length + ") and event types (" + eventTypes.Length + ")"); } _collectedEntities = new HashSet<Entity>(EntityEqualityComparer.comparer); _groups = groups; _eventTypes = eventTypes; Activate(); }
/// Creates a GroupObserver which observes all specified pools. /// This is useful when you want to create a GroupObserver for multiple pools /// which can be used with IGroupObserverSystem. public static GroupObserver CreateGroupObserver(this Pool[] pools, IMatcher matcher, GroupEventType eventType = GroupEventType.OnEntityAdded) { var groups = new Group[pools.Length]; var eventTypes = new GroupEventType[pools.Length]; for (int i = 0, poolsLength = pools.Length; i < poolsLength; i++) { groups[i] = pools[i].GetGroup(matcher); eventTypes[i] = eventType; } return(new GroupObserver(groups, eventTypes)); }
static GroupObserver createGroupObserver(Pool pool, TriggerOnEvent[] triggers) { var triggersLength = triggers.Length; var groups = new Group[triggersLength]; var eventTypes = new GroupEventType[triggersLength]; for (int i = 0; i < triggersLength; i++) { var trigger = triggers[i]; groups[i] = pool.GetGroup(trigger.trigger); eventTypes[i] = trigger.eventType; } return(new GroupObserver(groups, eventTypes)); }
ReactiveSystem(Pool pool, IReactiveExecuteSystem subSystem, IMatcher[] triggers, GroupEventType[] eventTypes) { _subsystem = subSystem; var ensureComponents = subSystem as IEnsureComponents; if (ensureComponents != null) { _ensureComponents = ensureComponents.ensureComponents; } var excludeComponents = subSystem as IExcludeComponents; if (excludeComponents != null) { _excludeComponents = excludeComponents.excludeComponents; } var groups = new Group[triggers.Length]; for (int i = 0, triggersLength = triggers.Length; i < triggersLength; i++) { groups[i] = pool.GetGroup(triggers[i]); } _observer = new GroupObserver(groups, eventTypes); _buffer = new List<Entity>(); }
public ClearReactiveSubSystemSpy(IMatcher matcher, GroupEventType eventType) : base(matcher, eventType) { }
public ReactiveSubSystemSpy(IMatcher matcher, GroupEventType eventType) { _matcher = matcher; _eventType = eventType; }
public ReactiveEnsureSubSystemSpy(IMatcher matcher, GroupEventType eventType, IMatcher ensureComponent) : base(matcher, eventType) { _ensureComponent = ensureComponent; }
/// Creates an EntityCollector for this group. public static EntityCollector CreateCollector(this Group group, GroupEventType eventType = GroupEventType.OnEntityAdded) { return(new EntityCollector(group, eventType)); }
/// Creates a GroupObserver for this group. public static GroupObserver CreateObserver(this Group group, GroupEventType eventType = GroupEventType.OnEntityAdded) { return(new GroupObserver(group, eventType)); }
public ReactiveSubSystemSpy(IMatcher matcher, GroupEventType eventType) { _matcher = matcher; _eventType = eventType; }
/// Creates an EntityCollector and will collect changed entities based on the specified eventType. public EntityCollector(Group group, GroupEventType eventType) : this(new [] { group }, new [] { eventType }) { }
public MultiReactiveSubSystemSpy(IMatcher[] matchers, GroupEventType[] eventTypes) { _matchers = matchers; _eventTypes = eventTypes; }
/// Creates a GroupObserver for this group. public static GroupObserver CreateObserver(this Group group, GroupEventType eventType = GroupEventType.OnEntityAdded) { return new GroupObserver(group, eventType); }
public TriggerOnEvent(IMatcher trigger, GroupEventType eventType) { this.trigger = trigger; this.eventType = eventType; }
public ClearReactiveSubSystemSpy(IMatcher matcher, GroupEventType eventType) : base(matcher, eventType) { }
internal MergeGroupEventArgs(IDocument A_0, IRowsEnumerator A_1, GroupEventType A_2, IMergeField A_3) : this(A_0, A_1, A_2) { this.imergeField_0 = A_3; }
public ReactiveExcludeSubSystemSpy(IMatcher matcher, GroupEventType eventType, IMatcher excludeComponent) : base(matcher, eventType) { _excludeComponent = excludeComponent; }
public GroupObserver(Group group, GroupEventType eventType) : this(new [] { group }, new [] { eventType }) { }
public MultiReactiveExcludeSubSystemSpy(IMatcher[] matchers, GroupEventType[] eventTypes, IMatcher excludeComponents) : base(matchers, eventTypes) { _excludeComponents = excludeComponents; }
public TriggerOnEvent(IMatcher trigger, GroupEventType eventType) { this.trigger = trigger; this.eventType = eventType; }
static GroupObserver createGroupObserver(Pool pool, TriggerOnEvent[] triggers) { var triggersLength = triggers.Length; var groups = new Group[triggersLength]; var eventTypes = new GroupEventType[triggersLength]; for (int i = 0; i < triggersLength; i++) { var trigger = triggers[i]; groups[i] = pool.GetGroup(trigger.trigger); eventTypes[i] = trigger.eventType; } return new GroupObserver(groups, eventTypes); }
public GroupObserver(Group group, GroupEventType eventType) : this(new [] { group }, new [] { eventType }) { }
public ReactiveEnsureExcludeSubSystemSpy(IMatcher matcher, GroupEventType eventType, IMatcher ensureComponent, IMatcher excludeComponent) : base(matcher, eventType) { _ensureComponent = ensureComponent; _excludeComponent = excludeComponent; }