コード例 #1
0
        public void Load(LibraryComponent lib, string fileName)
        {
            Init();

            var idents = new List <PuzzleIdent>();
            var file   = TrivialNameValueFileFormat.Load(lib.GetPathData(fileName));

            foreach (var pair in file)
            {
                if (pair.Key == "PuzzleExit.Duration")
                {
                    BatchExit.Duration = TimeSpan.FromSeconds(int.Parse(pair.Value));
                }

                if (pair.Key == "BatchExit.Duration")
                {
                    BatchExit.Duration = TimeSpan.FromSeconds(int.Parse(pair.Value));
                }

                if (pair.Key.StartsWith("Puzzle."))
                {
                    idents.Add(PuzzleIdent.Parse(pair.Value));
                }
            }

            AddRange(lib.LoadAllPuzzles(idents));
        }