Beispiel #1
0
        public static void Main(string[] args)
        {
            adventure = Adventure.Load(args[0]);
            player = new Player(adventure);

            if (player.HasSave) {
                if (AskYN("Do you want to load your save game?", true)) {
                    player.LoadSave();
                } else {
                    player.NewGame();
                }
            } else {
                player.NewGame();
            }

            player.Save();

            while (true) {
                Console.Clear();
                Console.Write(player.Page.Body.RenderConsole(player));

                Pause();
            }

            //Pause();
        }
Beispiel #2
0
        public static Adventure Load(string file)
        {
            XDocument doc = XDocument.Load(file);

            if (doc.Root.Name != XName.Get("cyoa", NS)) {
                throw new ApplicationException("That document is not an adventure document");
            }

            Adventure ret = new Adventure();

            ret.Name = System.IO.Path.GetFileNameWithoutExtension(file);

            ret.Load(doc.Root);

            return ret;
        }
Beispiel #3
0
 public Player(Adventure adventure)
 {
     this.Adventure = adventure;
     Flags = new HashSet<string>();
 }
Beispiel #4
0
 public Player(Adventure adventure)
 {
     this.Adventure = adventure;
     Flags          = new HashSet <string>();
 }