public ActivateItemTypeCommandHandler(IMatcherProvider matcherProvider, PlayerSystem playerSystem)
 {
     _activationMatcherGroup = matcherProvider.CreateMatcherGroup <Item, Activation, CurrentLocation, Owner>();
     _subsystemMatcherGroup  = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage>();
     _playerMatcherGroup     = matcherProvider.CreateMatcherGroup <Player, CurrentLocation>();
     _playerSystem           = playerSystem;
 }
Beispiel #2
0
        public void Initialize(Simulation ecs, SimulationConfiguration configuration)
        {
            _entityMatcherGroup = ecs.MatcherProvider.CreateMatcherGroup <TEntityType>();
            _entityMatcherGroup.MatchingEntityRemoved += MatchingEntityRemoved;

            _entityFilter?.Initialize(ecs, configuration);
        }
 public DropInventoryOnDisconnect(IMatcherProvider matcherProvider)
 {
     _playerMatcherGroup     = matcherProvider.CreateMatcherGroup <Player, ItemStorage, CurrentLocation>();
     _subsystemMatcherGroup  = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage>();
     _connectionMatcherGroup = matcherProvider.CreateMatcherGroup <Connection, GraphNode>();
     _itemMatcherGroup       = matcherProvider.CreateMatcherGroup <Item, Owner, CurrentLocation>();
 }
Beispiel #4
0
 public SwapSubsystemItemCommandHandler(IMatcherProvider matcherProvider, EventSystem eventSystem)
 {
     _playerMatcherGroup    = matcherProvider.CreateMatcherGroup <Player, ItemStorage, CurrentLocation>();
     _itemMatcherGroup      = matcherProvider.CreateMatcherGroup <Item, Owner, CurrentLocation, IItemType>();
     _subsystemMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage>();
     _eventSystem           = eventSystem;
 }
Beispiel #5
0
        public PathFindingSystem(IMatcherProvider matcherProvider, IEntityRegistry entityRegistry)
        {
            _subsystemMatcherGroup  = matcherProvider.CreateMatcherGroup <GraphNode, Subsystem, ExitRoutes>();
            _connectionMatcherGroup = matcherProvider.CreateMatcherGroup <GraphNode, Connection, MovementCost>();

            // TODO: handle new match route recalculation
            // TODO: handle graph node events that might affect routing
        }
Beispiel #6
0
        public TransferEnhancementSystem(IMatcherProvider matcherProvider, IEntityFactoryProvider entityFactoryProvider)
        {
            _entityFactoryProvider = entityFactoryProvider;

            // TODO: the matcher should be smart enough to infer all required types from the ComponentDependency attributes on the types specified
            _transferMatcherGroup = matcherProvider.CreateMatcherGroup <TransferEnhancement, ItemStorage>();
            _transferMatcherGroup.MatchingEntityAdded += OnNewEntity;
        }
Beispiel #7
0
        public GarbageDisposalSystem(IMatcherProvider matcherProvider,
                                     EventSystem eventSystem)
        {
            _garbageDisposalMatcherGroup = matcherProvider.CreateMatcherGroup <Engine.Systems.Activation.Components.Activation, GarbageDisposalActivator, CurrentLocation, Owner>();
            _subsystemMatcherGroup       = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage>();
            _itemMatcherGroup            = matcherProvider.CreateMatcherGroup <IItemType>();

            _eventSystem = eventSystem;
        }
 public SetActorDestinationCommandHandler(IMatcherProvider matcherProvider,
                                          PlayerSystem playerSystem,
                                          EventSystem eventSystem)
 {
     _playerMatcherGroup    = matcherProvider.CreateMatcherGroup <Player, Destination>();
     _subsystemMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem>();
     _playerSystem          = playerSystem;
     _eventSystem           = eventSystem;
 }
 public void Initialize(Simulation ecs, SimulationConfiguration configuration)
 {
     if (configuration.TrySelectNode(_node.Id, out _node) == false)
     {
         throw new ScenarioConfigurationException($"Node not found with id {_node.Id}");
     }
     _visitorsMatcherGroup = ecs.MatcherProvider.CreateMatcherGroup <Visitors>();
     _malwareMatcherGroup  = ecs.MatcherProvider.CreateMatcherGroup <MalwareGenome, MalwareVisibility>();
 }
Beispiel #10
0
        public SubsystemMovement(IMatcherProvider matcherProvider, MovementSpeedSystem movementSpeedSystem)
            : base(matcherProvider)
        {
            _movementSpeedSystem = movementSpeedSystem;

            // TODO: this is a good example where creating arbitrarily larger n-tuples might not be the best option
            // the flag components will never be used in the tuple but consume one valuable slot
            _subsystemMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem, GraphNode, Visitors, ExitRoutes, MovementCost>();
        }
Beispiel #11
0
        public ItemStorageSystem(IMatcherProvider matcherProvider)

        {
            _itemStorageMatcherGroup = matcherProvider.CreateMatcherGroup <ItemStorage>();
            _itemStorageMatcherGroup.MatchingEntityAdded += ItemStorage_EntityAdded;

            _itemMatcherGroup = matcherProvider.CreateMatcherGroup <IItemType>();
            _itemMatcherGroup.MatchingEntityRemoved += ItemMatcher_EntityRemoved;
        }
Beispiel #12
0
        public void Initialize(Simulation ecs, SimulationConfiguration configuration)
        {
            if (ecs.TryGetSystem(out _playerSystem) == false)
            {
                throw new SimulationException("Unable to get PlayerSystem for Evaluation");
            }

            _playerMatcherGroup = ecs.MatcherProvider.CreateMatcherGroup <Player, Destination>();
        }
Beispiel #13
0
        public ScannerSystem(IMatcherProvider matcherProvider,
                             EventSystem eventSystem)
        {
            _scannerMatcherGroup  = matcherProvider.CreateMatcherGroup <Engine.Systems.Activation.Components.Activation, Scanner, CurrentLocation, Owner>();
            _visitorsMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem, Visitors>();
            _malwareMatcherGroup  = matcherProvider.CreateMatcherGroup <MalwareGenome, MalwareVisibility>();
            _playerMatcherGroup   = matcherProvider.CreateMatcherGroup <Player, PlayerBitMask>();

            _eventSystem = eventSystem;
        }
 public void Initialize(Simulation ecs, SimulationConfiguration configuration)
 {
     if (configuration.TrySelectPlayer(_playerId, out _player) == false)
     {
         throw new ScenarioConfigurationException($"Player not found with id {_playerId}");
     }
     _playerMatcherGroup = ecs.MatcherProvider.CreateMatcherGroup <Player, ItemStorage>();
     _itemMatcherGroup   = ecs.MatcherProvider.CreateMatcherGroup <TItemType>();
     _filter?.Initialize(ecs, configuration);
 }
        public CoopMultiColourAntivirusSystem(IMatcherProvider matcherProvider,
                                              EventSystem eventSystem)
        {
            _antivirusMatcherGroup = matcherProvider.CreateMatcherGroup <Engine.Systems.Activation.Components.Activation, Components.Antivirus, CurrentLocation, Owner>();
            _subsystemMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem>();
            _locationMatcherGroup  = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage, Visitors>();
            _malwareMatcherGroup   = matcherProvider.CreateMatcherGroup <MalwareGenome, MalwarePropogation, CurrentLocation>();

            _eventSystem = eventSystem;
        }
Beispiel #16
0
        public TransferSystem(IMatcherProvider matcherProvider,
                              EventSystem eventSystem)
        {
            _transferActivatorMatcherGroup = matcherProvider.CreateMatcherGroup <Engine.Systems.Activation.Components.Activation, TransferActivator, CurrentLocation, Owner, TimedActivation>();
            _transferSystemMatcherGroup    = matcherProvider.CreateMatcherGroup <Subsystem, TransferEnhancement, ItemStorage>();
            _itemMatcherGroup           = matcherProvider.CreateMatcherGroup <IItemType, CurrentLocation, Owner>();
            _itemActivationMatcherGroup = matcherProvider.CreateMatcherGroup <IItemType, Engine.Systems.Activation.Components.Activation>();

            _eventSystem = eventSystem;
        }
Beispiel #17
0
        public AntivirusSystem(IMatcherProvider matcherProvider,
                               EventSystem eventSystem)
        {
            _antivirusMatcherGroup = matcherProvider.CreateMatcherGroup <Activation, Components.Antivirus, CurrentLocation, Owner, ConsumableActivation>();
            _subsystemMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem>();
            _visitorsMatcherGroup  = matcherProvider.CreateMatcherGroup <Visitors>();
            _malwareMatcherGroup   = matcherProvider.CreateMatcherGroup <MalwareGenome, MalwarePropogation, CurrentLocation>();

            _eventSystem = eventSystem;
        }
Beispiel #18
0
 public CreateMalwareCommandHandler(IEntityFactoryProvider entityFactoryProvider,
                                    IMatcherProvider matcherProvider,
                                    MovementSystem movementSystem,
                                    RNGSystem rngSystem)
 {
     _entityFactoryProvider = entityFactoryProvider;
     _movementSystem        = movementSystem;
     _nodeMatcherGroup      = matcherProvider.CreateMatcherGroup <GraphNode, Visitors, IEntityType>();
     _rngSystem             = rngSystem;
 }
Beispiel #19
0
        public AnalyserSystem(IMatcherProvider matcherProvider,
                              IEntityFactoryProvider entityFactoryProvider,
                              EventSystem eventSystem)
        {
            _analyserMatcherGroup  = matcherProvider.CreateMatcherGroup <Engine.Systems.Activation.Components.Activation, Analyser, CurrentLocation, Owner>();
            _subsystemMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage>();
            _captureMatcherGroup   = matcherProvider.CreateMatcherGroup <Capture>();

            _entityFactoryProvider = entityFactoryProvider;
            _eventSystem           = eventSystem;
        }
Beispiel #20
0
        public PlayerScoringSystem([InjectOptional] List <IPlayerScoringExtension> scoringExtensions,
                                   IMatcherProvider matcherProvider,
                                   PlayerSystem playerSystem,
                                   EventSystem eventSystem)
        {
            _scoringExtensions  = scoringExtensions;
            _playerMatcherGroup = matcherProvider.CreateMatcherGroup <Components.EntityTypes.Player, Score>();
            _playerSystem       = playerSystem;
            _eventSystem        = eventSystem;

            _endGameSubscription = eventSystem.Subscribe <EndGameEvent>(OnEndGameEvent);
        }
Beispiel #21
0
        public AntivirusEnhancementSystem(IMatcherProvider matcherProvider, IEntityFactoryProvider entityFactoryProvider)
        {
            _entityFactoryProvider = entityFactoryProvider;

            // TODO: the matcher should be smart enough to infer all required types from the ComponentDependency attributes on the types specified
            var antivirusMatcherGroup = matcherProvider.CreateMatcherGroup <AntivirusEnhancement, ItemStorage>();

            antivirusMatcherGroup.MatchingEntityAdded += OnNewEntity;

            _captureMatcherGroup = matcherProvider.CreateMatcherGroup <Capture>();
            _outputMatcherGroup  = matcherProvider.CreateMatcherGroup <Components.Antivirus>();
        }
Beispiel #22
0
        public TransferTimedPickupScoring(IMatcherProvider matcherProvider, EventSystem eventSystem)
        {
            _transferActivationSubscription        = eventSystem.Subscribe <TransferActivationEvent>(OnTransferActivationEvent);
            _pickupItemSubscription                = eventSystem.Subscribe <PickupItemEvent>(OnPickupItemEvent);
            _activateItemSubscription              = eventSystem.Subscribe <ActivateItemEvent>(OnActivateItemEvent);
            _pickupItemAndActivateHeldSubscription = eventSystem.Subscribe <SwapInventoryItemAndActivateEvent>(OnPickUpAndActivateHeldEvent);
            _pickupItemAndSwapWithHeldSubscription = eventSystem.Subscribe <SwapInventoryItemCommandEvent>(OnPickUpAndSwapHeldEvent);
            _moveItemSubscription = eventSystem.Subscribe <MoveItemCommandEvent>(OnMoveItemEvent);
            _swapItemSubscription = eventSystem.Subscribe <SwapSubsystemItemCommandEvent>(OnSwapItemEvent);

            _transferTiming = new Dictionary <int, TransferActivationEvent>();

            _playerScoreMatcherGroup = matcherProvider.CreateMatcherGroup <ITAlert.Simulation.Components.EntityTypes.Player, Score>();
        }
Beispiel #23
0
        public MalwarePropogationSystem(IMatcherProvider matcherProvider,
                                        IEntityFactoryProvider entityFactoryProvider,
                                        RNGSystem rngSystem,
                                        MovementSystem movementSystem,
                                        EventSystem eventSystem)
        {
            _entityFactoryProvider = entityFactoryProvider;
            _rngSystem             = rngSystem;
            _movementSystem        = movementSystem;
            _eventSystem           = eventSystem;

            // TODO: refactor to use tuple matcher
            _malwareMatcher   = matcherProvider.CreateMatcherGroup <MalwareGenome, CurrentLocation, MalwarePropogation, MalwareVisibility>();
            _subsystemMatcher = matcherProvider.CreateMatcherGroup <Subsystem, GraphNode>();
        }
Beispiel #24
0
        public TeamScoringSystem([InjectOptional] List <ITeamScoringExtension> scoringExtensions,
                                 IMatcherProvider matcherProvider,
                                 EventSystem eventSystem)
        {
            _scoringExtensions  = scoringExtensions;
            _playerMatcherGroup = matcherProvider.CreateMatcherGroup <Components.EntityTypes.Player, Score>();

            SystemHealth = new List <decimal>();
            foreach (var extension in scoringExtensions)
            {
                extension.Score += ExtensionOnScore;
            }
            _eventSystem         = eventSystem;
            _endGameSubscription = eventSystem.Subscribe <EndGameEvent>(OnEndGameEvent);
        }
Beispiel #25
0
 public AntivirusActivationScoringEventHandler(EventSystem eventSystem, IMatcherProvider matcherProvider)
     : base(eventSystem, matcherProvider)
 {
     _antivirusWorkstationMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem, AntivirusEnhancement>();
 }
Beispiel #26
0
 public ItemStorageConsumesMemoryEffect(IMatcherProvider matcherProvider)
 {
     _subsystemMatcher = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage, MemoryResource>();
     _itemMatcher      = matcherProvider.CreateMatcherGroup <IItemType, ConsumeMemory>();
 }
		public DisposePlayerOnDisconnect(IMatcherProvider matcherProvider)
		{
			_playerMatcherGroup = matcherProvider.CreateMatcherGroup<Player, ItemStorage, CurrentLocation>();
			_visitorsMatcherGroup = matcherProvider.CreateMatcherGroup<Visitors>();
		}
Beispiel #28
0
 public void Initialize(Simulation ecs, SimulationConfiguration configuration)
 {
     _malwareMatcherGroup = ecs.MatcherProvider.CreateMatcherGroup <MalwareGenome>();
 }
 public CPUConsumptionIncreasesTimedActivationDurationSystem(IMatcherProvider matcherProvider)
 {
     _timedActivationMatcherGroup = matcherProvider.CreateMatcherGroup <Engine.Systems.Activation.Components.Activation, TimedActivation, CurrentLocation>();
     _subsystemMatcher            = matcherProvider.CreateMatcherGroup <Subsystem, CPUResource, MovementCost>();
 }
Beispiel #30
0
 public ResetCPUEachTick(IMatcherProvider matcherProvider, IEntityRegistry entityRegistry)
 {
     _subsystemMatcher = matcherProvider.CreateMatcherGroup <Subsystem, CPUResource>();
 }