/// <summary> /// The main function. /// </summary> /// <param name="args"></param> private static void Main(string[] args) { try { /* Print startup message. */ Console.WriteLine("\nQuickHack Version 0.1"); Console.WriteLine("(C) Copyright 1996, 1997 by Thomas Biskup.\n"); if (args.Length > 1) return; Terminal.StandardPrintString("Setting up the game..."); /* Initialize everything. */ Terminal.StandardPrintString("."); Terminal.InitRand(); Terminal.StandardPrintString("."); var player = new Player(); var dungeon = new Dungeon(); var monsters = new Monsters(); var game = new Game(dungeon, monsters); monsters.InitMonsters(dungeon); Terminal.StandardPrintString("."); dungeon.InitDungeon(monsters, player); Terminal.StandardPrintString("."); player.InitPlayer(game); Terminal.StandardPrintString("."); InitScreen(); /* Play the game. */ game.Play(); /* Clean up. */ Terminal.CleanUpIO(); /* Be done. */ return; } catch (Exception ex) { try { Terminal.CleanUpIO(); } catch { } Console.WriteLine(ex); Console.ReadLine(); } }
/// <summary> /// Define all the basic dungeon structures and create the complete dungeon map. /// </summary> /// <param name="monsters"></param> /// <param name="player"></param> public void InitDungeon(Monsters monsters, Player player) { this.monsters = monsters; TheComplex.ThePlayer = player; TheComplex.Dig(); }