Пример #1
0
 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;
 }
Пример #2
0
 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>();
 }
Пример #3
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;
 }
Пример #4
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
        }
Пример #5
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;
        }
Пример #6
0
        public GarbageDisposalEnhancementSystem(IMatcherProvider matcherProvider, IEntityFactoryProvider entityFactoryProvider)
        {
            // TODO: the matcher should be smart enough to infer all required types from the ComponentDependency attributes on the types specified
            var garbageDisposalMatcherGroup = matcherProvider.CreateMatcherGroup <GarbageDisposalEnhancement, ItemStorage>();

            garbageDisposalMatcherGroup.MatchingEntityAdded += OnNewEntity;
            _entityFactoryProvider = entityFactoryProvider;
        }
Пример #7
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>();
        }
Пример #8
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;
 }
Пример #10
0
        public ItemStorageSystem(IMatcherProvider matcherProvider)

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

            _itemMatcherGroup = matcherProvider.CreateMatcherGroup <IItemType>();
            _itemMatcherGroup.MatchingEntityRemoved += ItemMatcher_EntityRemoved;
        }
Пример #11
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;
        }
Пример #12
0
 public CreateMalwareCommandHandler(IEntityFactoryProvider entityFactoryProvider,
                                    IMatcherProvider matcherProvider,
                                    MovementSystem movementSystem,
                                    RNGSystem rngSystem)
 {
     _entityFactoryProvider = entityFactoryProvider;
     _movementSystem        = movementSystem;
     _nodeMatcherGroup      = matcherProvider.CreateMatcherGroup <GraphNode, Visitors, IEntityType>();
     _rngSystem             = rngSystem;
 }
Пример #13
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;
        }
Пример #14
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;
        }
        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;
        }
Пример #16
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;
        }
Пример #17
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);
        }
Пример #18
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>();
        }
Пример #19
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>();
        }
Пример #20
0
        //TODO: replace with some sort of global components - or make the simulation or rather 'graph' or something an entity with the layout components on it

        public Simulation(SimulationConfiguration configuration,
                          IEntityRegistry entityRegistry,
                          IMatcherProvider matcherProvider,
                          ISystemRegistry systemRegistry,
                          // TODO: remove zenject dependency when implicit optional collection paramters is implemented
                          IEntityFactoryProvider entityFactoryProvider,
                          CommandQueue commandQueue)
            : base(configuration,
                   entityRegistry,
                   matcherProvider,
                   systemRegistry,
                   entityFactoryProvider,
                   commandQueue)
        {
        }
Пример #21
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);
        }
Пример #22
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>();
        }
Пример #23
0
 public AntivirusActivationScoringEventHandler(EventSystem eventSystem, IMatcherProvider matcherProvider)
     : base(eventSystem, matcherProvider)
 {
     _antivirusWorkstationMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem, AntivirusEnhancement>();
 }
Пример #24
0
 public ItemStorageConsumesMemoryEffect(IMatcherProvider matcherProvider)
 {
     _subsystemMatcher = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage, MemoryResource>();
     _itemMatcher      = matcherProvider.CreateMatcherGroup <IItemType, ConsumeMemory>();
 }
Пример #25
0
		public DisposePlayerOnDisconnect(IMatcherProvider matcherProvider)
		{
			_playerMatcherGroup = matcherProvider.CreateMatcherGroup<Player, ItemStorage, CurrentLocation>();
			_visitorsMatcherGroup = matcherProvider.CreateMatcherGroup<Visitors>();
		}
Пример #26
0
 public ResetCPUEachTick(IMatcherProvider matcherProvider, IEntityRegistry entityRegistry)
 {
     _subsystemMatcher = matcherProvider.CreateMatcherGroup <Subsystem, CPUResource>();
 }
Пример #27
0
        public PlayerInventorySystem(IMatcherProvider matcherProvider)

        {
            _playerMatcher    = matcherProvider.CreateMatcherGroup <Player, CurrentLocation, ItemStorage>();
            _subsystemMatcher = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage>();
        }
 public CPUConsumptionIncreasesTimedActivationDurationSystem(IMatcherProvider matcherProvider)
 {
     _timedActivationMatcherGroup = matcherProvider.CreateMatcherGroup <Engine.Systems.Activation.Components.Activation, TimedActivation, CurrentLocation>();
     _subsystemMatcher            = matcherProvider.CreateMatcherGroup <Subsystem, CPUResource, MovementCost>();
 }
Пример #29
0
 public SetHighlightCommandHandler(IMatcherProvider matcherProvider)
 {
     _highlightMatcherGroup = matcherProvider.CreateMatcherGroup <TutorialHighlight>();
 }
 protected MovementSystemExtensionBase(IMatcherProvider matcherProvider)
 {
     VisitorMatcherGroup = matcherProvider.CreateMatcherGroup<VisitorPosition, CurrentLocation, MovementSpeed, Destination>();
     _visitorsMatcherGroup = matcherProvider.CreateMatcherGroup<Visitors>();
 }