Ejemplo n.º 1
0
        private void AddSectorRight()
        {
            var newSector = new SectorScript(rightMostSector, null, SectorSize, biomes);

            sectors.Add(newSector);
            newSector.LeftSector        = rightMostSector;
            rightMostSector.RightSector = newSector;
            rightMostSector             = newSector;
        }
Ejemplo n.º 2
0
 public SectorScript(SectorScript leftSector, SectorScript rightSector, int size, Biomes biomes)
 {
     Size        = size;
     LeftSector  = leftSector;
     RightSector = rightSector;
     Biomes      = biomes;
     groundTiles = new GroundTileScript[Size];
     GenerateSector();
 }
Ejemplo n.º 3
0
        public override void _Ready()
        {
            sectors = new List <SectorScript>();
            biomes  = GetParent().GetChildren().OfType <Biomes>().FirstOrDefault();
            GD.Print(biomes.size);
            leftMostSector  = new SectorScript(null, null, SectorSize, biomes);
            rightMostSector = leftMostSector;
            GD.Print(leftMostSector.Size);
            sectors.Add(leftMostSector);
            AddSectorLeft();
            AddSectorRight();
            GD.Print("sectors : " + sectors.Count);
            var sector = leftMostSector;

            while (sector.RightSector != null)
            {
                GD.Print(sector.ToString());
                sector = sector.RightSector;
            }
            GD.Print(sector.ToString());
        }