Exemplo n.º 1
0
        /// <summary>
        /// Loads the specified file name.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <returns>The team.</returns>
        public static Team Load(String fileName)
        {
            // Read in the data
            var lines = System.IO.File.ReadAllLines(fileName);

            return(TeamFile.Parse(lines));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads the team from a SBS team file.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <returns>The team.</returns>
        public static Team Load(Stream stream)
        {
            var team = new Team();

            using (StreamReader reader = new StreamReader(stream))
            {
                var fileContents = reader.ReadToEnd();

                String[] lines = fileContents.Split(new String[] { "\r\n", "\n" }, StringSplitOptions.None);
                team = TeamFile.Parse(lines);
            }

            return(team);
        }