Beispiel #1
0
        /*int _ExpansionDistance;
         * int ExpansionGeneration;
         *
         * public int ExpansionDistance
         * {
         *  get
         *  {
         *      if (ExpansionGeneration < Generator.ExpansionGeneration)
         *          return 0;
         *      return _ExpansionDistance;
         *  }
         *  set
         *  {
         *      _ExpansionDistance = value;
         *      ExpansionGeneration = Generator.ExpansionGeneration;
         *  }
         * }*/

        public GeneratorCell(MapGenerator generator, int x, int y, GeneratorTile tile)
        {
            Generator = generator;
            Tile      = tile;
            X         = x;
            Y         = y;
        }
Beispiel #2
0
        public void GenerateOres(int times, int size, GeneratorTile ore)
        {
            var validTiles = AllCells().Select(GetCell).Where(cell => cell.Tile == GeneratorTile.Empty).ToList();

            for (int i = 0; i < times; i++)
            {
                var cell = validTiles.Pick(Random);
                if (cell.Tile != GeneratorTile.Empty)
                {
                    continue;
                }
                cell.Tile = ore;
                cell.AddSpread(new SpreadOre(null, size, 0.6f, ore));
            }
        }
Beispiel #3
0
 public DecoratorOre(GeneratorTile tile, int size, int times)
 {
     Tile  = tile;
     Size  = size;
     Times = times;
 }