示例#1
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;
        }
示例#2
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;
        }
示例#3
0
 public CreateMalwareCommandHandler(IEntityFactoryProvider entityFactoryProvider,
                                    IMatcherProvider matcherProvider,
                                    MovementSystem movementSystem,
                                    RNGSystem rngSystem)
 {
     _entityFactoryProvider = entityFactoryProvider;
     _movementSystem        = movementSystem;
     _nodeMatcherGroup      = matcherProvider.CreateMatcherGroup <GraphNode, Visitors, IEntityType>();
     _rngSystem             = rngSystem;
 }
示例#4
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;
        }
示例#5
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>();
        }
示例#6
0
 public PlayerSystem(SimulationConfiguration configuration,
                     IEntityFactoryProvider entityFactoryProvider,
                     GraphSystem graphSystem,
                     MovementSystem movementSystem,
                     [InjectOptional] List <IPlayerSystemBehaviour> playerSystemBehaviours)
 {
     _configuration           = configuration;
     _entityFactoryProvider   = entityFactoryProvider;
     _graphSystem             = graphSystem;
     _movementSystem          = movementSystem;
     _playterSystemBehaviours = playerSystemBehaviours;
     _playerEntityMapping     = new Dictionary <int, int>();
 }
示例#7
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)
        {
        }
示例#8
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>();
        }
示例#9
0
 public static bool TryCreateItem(this IEntityFactoryProvider entityFactoryProvider,
                                  string archetype,
                                  int?currentLocationId,
                                  int?ownerId,
                                  out ComponentEntityTuple <CurrentLocation, Owner> entityTuple)
 {
     if (entityFactoryProvider.TryCreateEntityFromArchetype(archetype, out var item) &&
         item.TryGetComponent <CurrentLocation>(out var currentLocation) &&
         item.TryGetComponent <Owner>(out var owner))
     {
         currentLocation.Value = currentLocationId;
         owner.Value           = ownerId;
         entityTuple           = new ComponentEntityTuple <CurrentLocation, Owner>(item, currentLocation, owner);
         return(true);
     }
     item?.Dispose();
     entityTuple = null;
     return(false);
 }
示例#10
0
 public DisplayTextCommandHandler(IEntityFactoryProvider entityFactoryProvider)
 {
     _entityFactoryProvider = entityFactoryProvider;
 }
示例#11
0
 public GraphSystem(SimulationConfiguration configuration,
                    IEntityFactoryProvider entityFactoryProvider)
 {
     _configuration         = configuration;
     _entityFactoryProvider = entityFactoryProvider;
 }
示例#12
0
 public CreateItemCommandHandler(IEntityFactoryProvider entityFactoryProvider,
                                 IMatcherProvider matcherProvider)
 {
     _entityFactoryProvider = entityFactoryProvider;
     _subsystemMatcherGroup = matcherProvider.CreateMatcherGroup <Subsystem, ItemStorage>();
 }