예제 #1
0
파일: Program.cs 프로젝트: pkmnfrk/cyoa
        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();
        }
예제 #2
0
파일: Adventure.cs 프로젝트: pkmnfrk/cyoa
        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;
        }
예제 #3
0
파일: Player.cs 프로젝트: pkmnfrk/cyoa
 public Player(Adventure adventure)
 {
     this.Adventure = adventure;
     Flags = new HashSet<string>();
 }
예제 #4
0
 public Player(Adventure adventure)
 {
     this.Adventure = adventure;
     Flags          = new HashSet <string>();
 }