Пример #1
0
    public void CreateNewPlayer()
    {
        for (int i = 0; i < EntityDecorator.Count; i++)
        {
            IEntityGenerator = EntityDecorator[i];


            if (EntityDecorator[i].GetType() == typeof(WeaponGenerator))
            {
                IEntityGenerator.Setup("AssaultRifle");
                myWeapon = EntityDecorator[i].Generate() as Weapon;
            }
            else if (EntityDecorator[i].GetType() == typeof(ArmorGenerator))
            {
                IEntityGenerator.Setup("NormalArmor");
                myArmor = EntityDecorator[i].Generate() as Armor;
            }
            else
            {
                IEntityGenerator.Setup("NormalUniform");
                mySkin = EntityDecorator[i].Generate() as Uniform;
            }
        }
        health = 100;
    }
Пример #2
0
 public ViewCreator(IEntityViewBehaviourInitializer entityViewBehaviourInitializer,
                    IEntityGenerator entityGenerator, GameContext context)
 {
     _entityViewBehaviourInitializer = entityViewBehaviourInitializer;
     _entityGenerator = entityGenerator;
     _context         = context;
 }
 public GameObjectEntitySplatGenerator(IEntityGenerator entitiesGenerator, IEntityPositionProvider positionProvider,
                                       AbstractSettingGenerator settingGenerator,
                                       Material grassMaterial, IEntitiesCountProvider entitiesCountProvider, IMeshProvider meshProvider,
                                       GameObjectGrassInstanceContainer gameObjectContainer)
     : base(entitiesGenerator, positionProvider, settingGenerator, grassMaterial, entitiesCountProvider,
            meshProvider)
 {
     _gameObjectContainer = gameObjectContainer;
 }
Пример #4
0
 public GetFilteredFlightsHandler(
     IRepository <Flight> flightsRepository,
     IRepository <Location> locationsRepository,
     IEntityGenerator <Flight, Location> entityGenerator)
 {
     _flightsRepository   = flightsRepository;
     _entityGenerator     = entityGenerator;
     _locationsRepository = locationsRepository;
 }
Пример #5
0
 public CodeGenerator(
     IEntityGenerator entityGenerator,
     IServiceGenerator serviceGenerator,
     IViewGenerator viewGenerator,
     IControllerGenerator controllerGenerator)
 {
     _entityGenerator     = entityGenerator;
     _serviceGenerator    = serviceGenerator;
     _viewGenerator       = viewGenerator;
     _controllerGenerator = controllerGenerator;
 }
 public GpuInstancingEntitySplatGenerator(IEntityGenerator entitiesGenerator,
                                          IEntityPositionProvider positionProvider, AbstractSettingGenerator settingGenerator,
                                          Material grassMaterial, IEntitiesCountProvider entitiesCountProvider,
                                          IMeshProvider meshProvider, GpuInstancingGrassInstanceContainer gpuGrassInstanceContainer,
                                          GpuInstancingGrassInstanceGenerator grassInstanceGenerator)
     : base(entitiesGenerator, positionProvider, settingGenerator, grassMaterial, entitiesCountProvider,
            meshProvider)
 {
     _gpuGrassInstanceContainer = gpuGrassInstanceContainer;
     _grassInstanceGenerator    = grassInstanceGenerator;
 }
 public StandardEntitySplatGenerator(IEntityGenerator entitiesGenerator, IEntityPositionProvider positionProvider,
                                     AbstractSettingGenerator settingGenerator, Material grassMaterial,
                                     IEntitiesCountProvider entitiesCountProvider, IMeshProvider meshProvider)
 {
     _entitiesGenerator     = entitiesGenerator;
     _positionProvider      = positionProvider;
     _settingGenerator      = settingGenerator;
     _grassMaterial         = grassMaterial;
     _entitiesCountProvider = entitiesCountProvider;
     _meshProvider          = meshProvider;
 }
Пример #8
0
 public EntitiesCodeGenerator(
     IEntityGenerator entityGenerator,
     IServiceGenerator serviceGenerator,
     IViewGenerator viewGenerator,
     IControllerGenerator controllerGenerator,
     BaseGeneratorDatabaseCreator databaseGenerator) : base(databaseGenerator)
 {
     _entityGenerator     = entityGenerator;
     _serviceGenerator    = serviceGenerator;
     _viewGenerator       = viewGenerator;
     _controllerGenerator = controllerGenerator;
 }
Пример #9
0
 public SqlDataLayerGenerator(IMapper mapperService,ITableProvider tableProvider, IKeyProvider keyProvider, IViewProvider viewProvider, IStoredProcedureProvider storedProcedureProvider, IParameterProvider parameterProvider, IEntityGenerator entityGenerator, IProviderGenerator providerGenerator,INinjectModuleGenerator ninjectModuleGenerator,[Named("settings")]IParameterReaderService parameterReaderService)
 {
     _mapper = mapperService;
     _tableProvider = tableProvider;
     _keyProvider = keyProvider;
     _viewProvider = viewProvider;
     _storedProcedureProvider = storedProcedureProvider;
     _parameterProvider = parameterProvider;
     _entityGenerator = entityGenerator;
     _providerGenerator = providerGenerator;
     _ninjectModuleGenerator = ninjectModuleGenerator;
     _parameterReaderService = parameterReaderService;
 }
Пример #10
0
        public WorldActorFiller(GameContext context, ISavedComponents savedComponents, IRandomNumberGenerator rng,
                                IGameConfig gameConfig, IEntityGenerator entityGenerator, IExampleContextManager contextManager,
                                IFirstPlaceInAreaFinder placeFinder)
        {
            _rng             = rng;
            _gameConfig      = gameConfig;
            _entityGenerator = entityGenerator;
            _contextManager  = contextManager;

            _context         = context;
            _savedComponents = savedComponents;
            _placeFinder     = placeFinder;
        }
Пример #11
0
        private void LoadBenchmark()
        {
            var  types = Utils.LoadTypes(_baseDirectory);
            Type benchmarkGeneratorType = types
                                          .FirstOrDefault(y => !y.IsAbstract && y.GetInterfaces().Contains(typeof(IBenchmarkGenerator)));

            if (benchmarkGeneratorType == null)
            {
                throw new Exception("No benchmark generator found");
            }
            _benchmarkGenerator = (IBenchmarkGenerator)Activator.CreateInstance(benchmarkGeneratorType);
            _entityGenerator    = new CustomDataGenerator();
        }
Пример #12
0
 public ActionFactory(IGrid grid, IActionEffectFactory actionEffectFactory, IUnityGridInfoProvider unityGridInfoProvider, IPositionEffectPresenter positionEffectPresenter, IRandomNumberGenerator randomNumberGenerator, IDeathHandler deathHandler, ISceneContext sceneContext, IGameConfig gameConfig, IViewCreator viewCreator, ITileMatrixUpdater tileMatrixUpdater, IFirstPlaceInAreaFinder firstPlaceInAreaFinder, IBroadcastStimulusSender stimulusBroadcaster, IEntityDetector entityDetector, LoadViewSystem loadViewSystem, IUiFacade uiFacade, IOsnowaContextManager contextManager, IEntityViewBehaviourInitializer entityViewBehaviourInitializer, IAggressionTriggerer aggressionTriggerer, IEntityGenerator entityGenerator, ReactiveFeature reactiveFeature)
 {
     _grid = grid;
     _unityGridInfoProvider   = unityGridInfoProvider;
     _positionEffectPresenter = positionEffectPresenter;
     _randomNumberGenerator   = randomNumberGenerator;
     _deathHandler            = deathHandler;
     _actionEffectFactory     = actionEffectFactory;
     _sceneContext            = sceneContext;
     _gameConfig             = gameConfig;
     _viewCreator            = viewCreator;
     _tileMatrixUpdater      = tileMatrixUpdater;
     _firstPlaceInAreaFinder = firstPlaceInAreaFinder;
     _stimulusBroadcaster    = stimulusBroadcaster;
     _entityDetector         = entityDetector;
     _loadViewSystem         = loadViewSystem;
     _uiFacade       = uiFacade;
     _contextManager = contextManager;
     _entityViewBehaviourInitializer = entityViewBehaviourInitializer;
     _aggressionTriggerer            = aggressionTriggerer;
     _entityGenerator = entityGenerator;
     _reactiveFeature = reactiveFeature;
 }
Пример #13
0
 private void AddGenerator(IEntityGenerator g)
 {
     _generators.Add(g.TypeName.ToLower(), g);
 }
Пример #14
0
 public void AddDecorator(IEntityGenerator decorator)
 {
     //Can be Used for more Decorators if i know something new
 }
Пример #15
0
 public EntityScaffolder(ScaffolderDependencies dependencies, IEntityGenerator generator) : base(dependencies)
 {
     Generator = generator;
 }
Пример #16
0
        public static async Task SeedAsync(ScannerContext scannerContext, ILoggerFactory loggerFactory, IEntityGenerator <Flight, Location> entityGenerator, int?retry = 0)
        {
            int retryForAvailability = retry.Value;

            try
            {
                if (!scannerContext.CabinClasses.Any())
                {
                    scannerContext.CabinClasses.AddRange(GetPreconfiguredCabinClasses());
                    await scannerContext.SaveChangesAsync();
                }

                if (!scannerContext.Locations.Any())
                {
                    scannerContext.Locations.AddRange(await GetLocationsFromApi());
                    await scannerContext.SaveChangesAsync();
                }

                if (!scannerContext.Flights.Any())
                {
                    scannerContext.Flights.AddRange(await entityGenerator.GenerateRandomEntities(await scannerContext.Locations.ToListAsync(), 500000));
                    await scannerContext.SaveChangesAsync();
                }

                if (!scannerContext.Tickets.Any())
                {
                    scannerContext.Tickets.AddRange(await GetPreconfiguredTickets(scannerContext));
                    await scannerContext.SaveChangesAsync();
                }
            }
            catch (Exception ex)
            {
                if (retryForAvailability < 3)
                {
                    retryForAvailability++;
                    var log = loggerFactory.CreateLogger <ScannerContextSeed>();
                    log.LogError(ex.Message);
                    await SeedAsync(scannerContext, loggerFactory, entityGenerator, retryForAvailability);
                }
            }
        }
Пример #17
0
 public BaseTest(IEntityGenerator <TEntity> generator, IGenerator <TViewmodel> viewModelGenerator)
 {
     this.Generator          = generator;
     this.ViewModelGenerator = viewModelGenerator;
 }
Пример #18
0
 private void AddGenerator(IEntityGenerator g)
 {
     _generators.Add(g.TypeName.ToLower(), g);
 }