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(); }
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; }
public Player(Adventure adventure) { this.Adventure = adventure; Flags = new HashSet<string>(); }
public Player(Adventure adventure) { this.Adventure = adventure; Flags = new HashSet <string>(); }