public void TestDeserialiseMerlinStatic()
        {
            FileStream smallMazeFile = new FileStream(@"C:\Users\Philip\Desktop\HoverGame\HOVER\MAZES\MAZE1.MAZ", FileMode.Open);
            var classRegistry = new MfcClassRegistry();
            classRegistry.RegisterClass("CMerlinStatic", typeof(CMerlinStatic));
            classRegistry.RegisterClass("CMerlinLocation", typeof(CMerlinLocation));

            MfcDeserialiser archive = new MfcDeserialiser(smallMazeFile, classRegistry);
            Maze maze = new Maze();
            maze.Deserialise(archive);
        }
        public void TestDeserialiseMerlinStatic()
        {
            FileStream smallMazeFile = new FileStream(@"C:\Users\Philip\Desktop\HoverGame\HOVER\MAZES\MAZE1.MAZ", FileMode.Open);
            var        classRegistry = new MfcClassRegistry();

            classRegistry.RegisterClass("CMerlinStatic", typeof(CMerlinStatic));
            classRegistry.RegisterClass("CMerlinLocation", typeof(CMerlinLocation));

            MfcDeserialiser archive = new MfcDeserialiser(smallMazeFile, classRegistry);
            Maze            maze    = new Maze();

            maze.Deserialise(archive);
        }
Esempio n. 3
0
        public MfcSerialiser(Stream output, MfcClassRegistry classRegistry)
        {
            this._stream        = new BinaryWriter(output);
            this._classRegistry = classRegistry;
            this._loadedClasses = new List <MfcClass>();
            this._loadedObjects = new List <MfcObject>();

            // Class index zero isn't used/represents an error
            _loadedClasses.Add(null);

            // Object index zero isn't used/represents a null pointer
            _loadedObjects.Add(null);
        }
Esempio n. 4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            FileStream smallMazeFile = new FileStream(@"C:\Users\Philip\Desktop\HoverGame\HOVER\MAZES\small.MAZ", FileMode.Open);
            var classRegistry = new MfcClassRegistry();
            classRegistry.AutoRegisterClasses(typeof(Maze).Assembly);

            MfcDeserialiser archive = new MfcDeserialiser(smallMazeFile, classRegistry);
            Maze maze = new Maze();
            maze.Deserialise(archive);

            var form = new HoverForm(maze);
            MainLoop renderFrame = form.RunFrame;
            MessagePump.Run(form, renderFrame);
        }