void Application::main()
{
	while (1){
		char command;
		TopMenu("MAIN MENU");
		iface->drawString("a. Add book\n");
		iface->drawString("b. Remove book\n");
		iface->drawString("c. Show books\n");
		iface->drawString("d. Play\n");
		iface->drawString("q. Quit(!)\n\n");
		iface->drawString("   > ");
		iface->readChar(command);
		if (command == 'a'){
			addBook();
		}
		else if (command == 'b'){
			removeBook();
		}
		else if (command == 'c'){
			showBooks();
		}
		else if (command == 'd') {
			play();
		}
		else if (command == 'q'){
			saveBooks();
			exit(0);
		}
	}
}
Exemple #2
0
Library::~Library()
{
	saveBooks();
	saveUsers();
}