Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- string profile_name;
- /*
- * Menu -> Create a Character
- * -> Load a Character
- *
- * Load Modules
- *
- * -> Chat Window
- * -> Tattooer
- * -> Reanimator / Concoctionator
- * -> Defense
- * -> Offense
- * -> Queue
- *
- * (if Applicible)-> Affliction Window (this character)
- * (if Applicible)-> Affliction Window (Enemy/Target Character)
- *
- */
- /*
- * ->Have this program running before opening a client.( zmud, cmud, mudlet, tf5, etc.) This program will control connecting to server.
- * ->User connects to localhost/127.0.0.1 on port 123
- */
- void CharacterCreator()
- {
- ofstream profile;
- string profile_password;
- string state;
- char response;
- cout << "What is your Characters' name?\n";
- cin >> profile_name;
- cout << "\n";
- //getline(cin,profile_name);
- cout << "You said your Characters' name is " << profile_name << "?\n\n";
- cout << "Is this correct?\n";
- cout << "(y or n)\n";
- cin >> response;
- switch(response)
- {
- case 'y':
- cout << "\n";
- cout << "///////////////////////////////////\n";
- cout << "Creating profile -> "<< profile_name <<".\n";
- cout << "///////////////////////////////////\n\n";
- profile.open( profile_name.c_str() );
- profile << profile_name <<"\n";
- cout << "What is " << profile_name <<"s' password?\n";
- cin >> profile_password;
- profile << profile_password <<"\n";
- profile.close();
- cout << "\n";
- cout << "///////////////////////////////////\n";
- cout << "Profile Created.\n";
- cout << "///////////////////////////////////\n\n";
- break;
- case 'n':
- CharacterCreator();
- break;
- default:
- cout << "Invalid choice.\n";
- CharacterCreator();
- }
- }
- void LoadProfile()
- {
- string line;
- char response;
- cout << "Which profile are we loading?\n";
- cin >> profile_name;
- cout << "\n";
- //getline(cin,profile_name);
- cout << profile_name << ", is the profile we are loading?\n\n";
- cout << "Is this correct?\n";
- cout << "(y or n)\n";
- cin >> response;
- switch(response)
- {
- case 'y':
- cout << "\n";
- cout << "///////////////////////////////////\n";
- cout << "Loading profile -> "<< profile_name <<".\n";
- cout << "///////////////////////////////////\n\n";
- /*ifstream profile ( profile_name.c_str() );
- if (profile.is_open())
- {
- while ( getline (profile_name,line) )
- {
- cout << line << '\n';
- }
- profile.close();
- }
- else cout << "Unable to open file";
- */
- break;
- case 'n':
- LoadProfile();
- break;
- default:
- cout << "Invalid choice.\n";
- LoadProfile();
- }
- }
- void menu()
- {
- int input;
- cout << " 1. Create a Character Profile.\n";
- cout << " 2. Load a Character Profile.\n";
- cout << " 3. Connect to Aetolia.\n";
- cout << " 4. View Current Installed Modules.\n";
- cout << " 5. Add a Module.\n";
- cout << " 6. Delete a Module.\n";
- cout << " 7. Exit Blasphemy.\n\n";
- cout << "Selection: ";
- cin >> input;
- cout << endl;
- switch (input) {
- case 1:
- CharacterCreator();
- menu();
- break;
- case 2:
- LoadProfile();
- menu();
- break;
- case 3:
- menu();
- break;
- case 4:
- menu();
- break;
- case 5:
- menu();
- break;
- case 6:
- menu();
- break;
- case 7:
- return;
- break;
- }
- return;
- }
- int main()
- {
- cout << "Welcome to the Blasphemy Console!\n";
- cout << endl;
- menu();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement