Example #1
0
 private void loadTerrains()
 {
     string[] files = Directory.GetFiles(BloxorzForm.DIR_OF_LEVELS);
     foreach (string file in files)
     {
         try
         {
             lbLevels.Items.Add(Terrain.loadTerrain(file));
         } catch (InvalidMapFileException e) {
             lbErrors.Items.Add(e);
         }
     }
     if (lbLevels.Items.Count > 0)
     {
         this.lbLevels.SelectedIndex = 0;
         this.currentTerrain = (Terrain)lbLevels.SelectedItem;
         this.initTerrain();
     }
     else
     {
         MessageBox.Show("No level found (dir: " + BloxorzForm .DIR_OF_LEVELS+ ")");
     }
 }
Example #2
0
 public List<Tuple<Block, Move>> legalNeighbors(Terrain terrain)
 {
     return this.neighbors().Where(item => terrain.isLegalBlock(item.Item1)).ToList();
 }
Example #3
0
 private void lbLevels_SelectedIndexChanged(object sender, EventArgs e)
 {
     if ( ( this.lbLevels.SelectedItem != null ) && ( this.lbLevels.SelectedItem is Terrain ) )
     {
         this.currentTerrain = (Terrain) this.lbLevels.SelectedItem;
         this.currentTerrain.reStart();
         this.initTerrain();
     }
 }