using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace BilaPani { public static class ManipulaceSeSoubory { public static bool ExistujeSoubor(string cesta) { if (File.Exists(cesta)) return true; return false; } public static void NahratMapu(string cesta) { //přečtení souboru s mapou string[] radky = File.ReadAllLines(cesta); //zjištění rozměrů mapy string[] prvniRadek = radky[0].Split(' '); //zadefinování nové, prázdné mapy mapa.dataMapy = new mapa.TypPole[Int32.Parse(prvniRadek[0]), Int32.Parse(prvniRadek[1])]; //naplnění dat mapy for (int y = 0; y < mapa.dataMapy.GetLength(1); y++) { for (int x = 0; x < mapa.dataMapy.GetLength(0); x++) { char c = radky[y+1][x]; if (!mapa.JePohybZveda(c)) mapa.dataMapy[x, y] = mapa.ZiskatPoleZCharu(c, x, y); } } } } }