public bool Evaluate(Simulation ecs, SimulationConfiguration configuration)
 {
     return(_playerMatcherGroup.TryGetMatchingEntity(_player.EntityId, out var playerTuple) &&
            playerTuple.Component2.Items[0]?.Item != null &&
            _itemMatcherGroup.TryGetMatchingEntity(playerTuple.Component2.Items[0].Item.Value, out var itemTuple) &&
            (_filter == null || _filter.Evaluate(itemTuple.Entity)));
 }
Example #2
0
 public bool Evaluate(Simulation ecs, SimulationConfiguration configuration)
 {
     return(_itemMatcherGroup.MatchingEntities.Any(itemTuple =>
                                                   itemTuple.Component2.ActivationState == _activationState &&
                                                   (_entityConfig == null || itemTuple.Component3.Value == _entityConfig.EntityId) &&
                                                   (_filter == null || _filter.Evaluate(itemTuple.Entity))));
 }
Example #3
0
 private void MatchingEntityRemoved(Entity entity)
 {
     if (_entityFilter?.Evaluate(entity) ?? true)
     {
         _disposedHandle.Set();
     }
 }
Example #4
0
 public bool Evaluate(Simulation ecs, SimulationConfiguration configuration)
 {
     if (_nodeEntityConfig == null)
     {
         return(_locationMatcherGroup.MatchingEntities.Any(locationTuple =>
                                                           locationTuple.Component1.Values.Any(v => _malwareMatcherGroup.TryGetMatchingEntity(v, out var malwareTuple) &&
                                                                                               (_filter == null || _filter.Evaluate(malwareTuple.Entity)))));
     }
     else
     {
         return(_locationMatcherGroup.TryGetMatchingEntity(_nodeEntityConfig.EntityId, out var locationTuple) &&
                locationTuple.Component1.Values.Any(v => _malwareMatcherGroup.TryGetMatchingEntity(v, out var malwareTuple) &&
                                                    (_filter == null || _filter.Evaluate(malwareTuple.Entity))));
     }
 }