コード例 #1
0
        public FruaSavedGame Load()
        {
            var game = new FruaSavedGame();

            using (var file = new FileStream(_path, FileMode.Open))
            {
                using (var reader = new BinaryReader(file))
                {
                    reader.ReadByte();   // not defined
                    game.NoMagicFlag = reader.ReadByte();
                    reader.ReadBytes(3); // not defined
                    game.Rounds = reader.ReadByte();
                    game.Turns  = reader.ReadByte();
                    game.Hours  = reader.ReadByte();
                    game.Days   = reader.ReadByte();
                    game.Months = reader.ReadByte();
                    game.Years  = reader.ReadByte();
                }
            }

            return(game);
        }
コード例 #2
0
ファイル: FruaSavedGameFile.cs プロジェクト: bsimser/goldbox
        public FruaSavedGame Load()
        {
            var game = new FruaSavedGame();

            using (var file = new FileStream(_path, FileMode.Open))
            {
                using (var reader = new BinaryReader(file))
                {
                    reader.ReadByte(); // not defined
                    game.NoMagicFlag = reader.ReadByte();
                    reader.ReadBytes(3);  // not defined
                    game.Rounds = reader.ReadByte();
                    game.Turns = reader.ReadByte();
                    game.Hours = reader.ReadByte();
                    game.Days = reader.ReadByte();
                    game.Months = reader.ReadByte();
                    game.Years = reader.ReadByte();
                }
            }

            return game;
        }