AppendWallsAndDoors() private méthode

private AppendWallsAndDoors ( string p ) : void
p string
Résultat void
Exemple #1
0
        private static Room[] LoadFromFile()
        {
            RoomBuilder  rb = new RoomBuilder();
            StreamReader s  = new StreamReader(File.Open("Maze2.txt", FileMode.Open));

            while (!s.EndOfStream)
            {
                string data = s.ReadLine();

                if (data.Length > 0)
                {
                    switch (data[0])
                    {
                    case '|':
                        rb.AppendWallsAndDoors(data.Substring(1));
                        break;

                    case ':':
                        rb.BeginNewRoom(data.Substring(1));
                        break;

                    default:
                        break;
                    }
                }
            }

            s.Dispose();
            return(rb.GetRooms());
        }
Exemple #2
0
        private static Room[] LoadFromFile()
        {
            RoomBuilder rb = new RoomBuilder();
            StreamReader s = new StreamReader(File.Open("Maze2.txt", FileMode.Open));

            while (!s.EndOfStream) {
                string data = s.ReadLine();

                if (data.Length > 0) {
                    switch (data[0]) {
                    case '|':
                        rb.AppendWallsAndDoors(data.Substring(1));
                        break;

                    case ':':
                        rb.BeginNewRoom(data.Substring(1));
                        break;

                    default:
                        break;
                    }
                }
            }

            s.Dispose();
            return rb.GetRooms();
        }