コード例 #1
0
 public Game()
 {
     Messages = new List<string>();
     Players = new ThreadSafeList<Player>();
     ActorList = new List<Actor>();
     BulletList = new List<Bullet>();
     Map = new Map();
 }
コード例 #2
0
        public static Map CreateFromArray(string[] data)
        {
            Map map = new Map();
            for (int y = 0; y < data.Length; y++)
            {
                string line = data[y];
                List<Tile> list = new List<Tile>();
                for (int x = 0; x < line.Length; x++)
                {
                    char symbol = line[x];
                    Tile tile = new Tile(x, y);
                    tile.Symbol = symbol;
                    if (symbol != ' ') tile.IsSolid = true;

                    list.Add(tile);
                }
                map.Tiles.Add(list);
            }
            return map;
        }
コード例 #3
0
 public void LoadMap(string filename)
 {
     string[] data = File.ReadAllLines(@"Maps\" + filename);
     LoadedMap = Map.CreateFromArray(data);
 }