Example #1
0
        public void Init(IExampleContext context, ShapeIngredientConfig config, WorldGeneratorConfig worldGeneratorConfig, ValueMap initialShapeValues)
        {
            _worldGeneratorConfig = worldGeneratorConfig;
            _config             = config;
            _initialShapeValues = initialShapeValues;
            base.Init(context, config, worldGeneratorConfig);

            Values = new ValueMap(1, worldGeneratorConfig.XSize, worldGeneratorConfig.YSize);
        }
Example #2
0
        public void Init(IExampleContext context, WalkabilityIngredientConfig config, WorldGeneratorConfig worldGeneratorConfig, ValueMap waterMap)
        {
            _context  = context;
            _config   = config;
            _waterMap = waterMap;
            Values    = new ValueMap(1, worldGeneratorConfig.XSize, worldGeneratorConfig.YSize);

            base.Init(context, config, worldGeneratorConfig);
        }
        public void Init(IExampleContext context, InitialHeightIngredientConfig config, WorldGeneratorConfig worldGeneratorConfig, IRandomNumberGenerator rng)
        {
            _config      = config;
            _rng         = rng;
            _noiseOffset = new Position(_rng.Next(10000), _rng.Next(10000));

            base.Init(context, config, worldGeneratorConfig);

            Values = new ValueMap(1, worldGeneratorConfig.XSize, worldGeneratorConfig.YSize);
        }
Example #4
0
        public void Init(IExampleContext context, WaterIngredientConfig config, WorldGeneratorConfig worldGeneratorConfig, IRandomNumberGenerator rng, ValueMap heightMapValues)
        {
            _config          = config;
            _heightMapValues = heightMapValues;
            base.Init(context, config, worldGeneratorConfig);

            _rng   = rng;
            Values = new ValueMap(1, worldGeneratorConfig.XSize, worldGeneratorConfig.YSize);

            _tileset = worldGeneratorConfig.Tileset;
        }
Example #5
0
        protected void Init(IExampleContext context, MapIngredientConfig mapIngredientConfig, WorldGeneratorConfig worldGeneratorConfig)
        {
            GameContext = context;
            Config      = mapIngredientConfig;

            Config.OnUpdate += () =>
            {
#if UNITY_EDITOR
                EditorCoroutines.StartCoroutine(CleanUpAndStartRecalculating(), this);
#endif
                RefreshVisualisation();
            };
        }
Example #6
0
        public void Init(IExampleContext context, VegetationIngredientConfig config,
                         WorldGeneratorConfig worldGeneratorConfig, IRandomNumberGenerator rng, ValueMap soilMap, ValueMap heightMap)
        {
            _rng       = rng;
            _config    = config;
            _soilMap   = soilMap;
            _heightMap = heightMap;
            base.Init(context, config, worldGeneratorConfig);

            Values        = new ValueMap(1, worldGeneratorConfig.XSize, worldGeneratorConfig.YSize);
            _plants       = new Plant[worldGeneratorConfig.XSize, worldGeneratorConfig.YSize];
            _initialSeeds = (int)(worldGeneratorConfig.XSize * worldGeneratorConfig.YSize *
                                  _config.InitialSeedsPerPosition);
            _tileMatricesByte = context.TileMatricesByLayer;
        }
Example #7
0
        public void Init(IExampleContext context, SoilIngredientConfig config, WorldGeneratorConfig worldGeneratorConfig,
                         IRandomNumberGenerator rng, ValueMap heightMapValues,
                         ValueMap waterMapValues)
        {
            _heightMapValues = heightMapValues;
            _waterMapValues  = waterMapValues;
            _config          = config;
            base.Init(context, config, worldGeneratorConfig);

            _rng   = rng;
            Values = new ValueMap(1, worldGeneratorConfig.XSize, worldGeneratorConfig.YSize);
            new Position(_rng.Next(10000), _rng.Next(10000));
            _tileMatricesByte = context.TileMatricesByLayer;
            _tileset          = worldGeneratorConfig.Tileset;
        }
Example #8
0
        public void FillWithActors(float enemyCountRate = 1f)
        {
            IExampleContext context   = _contextManager.Current;
            var             stopwatch = Stopwatch.StartNew();

            Contexts.sharedInstance.SubscribeId();

            ClearContexts(context);

            MarkIsolatedAreas(context);

            GeneratePlayer(context);
            GenerateWildlife(context, enemyCountRate);

            //SaveAllComponents();
            List <GameEntity> allEntities = _context.GetEntities().ToList();

            Debug.Log(
                $"Filled the world with {_context.GetEntities().Length} entities in {stopwatch.ElapsedMilliseconds} milliseconds. ");
        }
Example #9
0
 private void ClearContexts(IExampleContext context)
 {
     _context.DestroyAllEntities();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioStationsRepository"/> class.
 /// </summary>
 /// <param name="context">The Example database context.</param>
 public RadioStationsRepository(IExampleContext context)
 {
     this.context = context;
 }
 public UpperCaseService(IExampleContext context)
 {
     _context = context;
 }
Example #12
0
 public UpdateExampleCommandHandler(IExampleContext exampleContext, IMapper mapper)
 {
     _exampleContext = exampleContext;
     _mapper         = mapper;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CountriesRepository"/> class.
 /// </summary>
 /// <param name="context">The Example database context.</param>
 public CountriesRepository(IExampleContext context)
 {
     this.context = context;
 }
Example #14
0
        public new void Init(IExampleContext context, MapIngredientConfig config, WorldGeneratorConfig worldGeneratorConfig)
        {
            Values = new ValueMap(1, worldGeneratorConfig.XSize, worldGeneratorConfig.YSize);

            base.Init(context, config, worldGeneratorConfig);
        }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioStationsRepository"/> class.
 /// </summary>
 /// <param name="context">The Example database context.</param>
 public RadioStationsRepository(IExampleContext context)
 {
     this.context = context;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CountriesRepository"/> class.
 /// </summary>
 /// <param name="context">The Example database context.</param>
 public CountriesRepository(IExampleContext context)
 {
     this.context = context;
 }