diff --git a/CreateTeam.cpp b/CreateTeam.cpp index e0d48ea..a734ce5 100644 --- a/CreateTeam.cpp +++ b/CreateTeam.cpp @@ -1,4 +1,3 @@ -// // CreateTeam.cpp // BasketBallGame // @@ -10,19 +9,23 @@ #include using namespace std; +//Calling create team class - Suraj CreateTeam::CreateTeam() { } +//Calling Create players function - Suraj void CreateTeam::create_players() { + // communicating user input int number_of_players = 5; cout << "" << endl; cout << "" << endl; cout << "You now to create 5 different players for your team, allocating attributes for each player" << endl; cout << "Each attribute value of 1 equals the use of £10 in currency" << endl; + // for loop for creating players, updating currency and storing in a vector int currency = 10000; for(int i=0; i using namespace std; +/* this class will be used to create user players for the user team - Suraj */ + + +// Creating class - Suraj class CreateTeam { private: + // private vector for stbring players std::vector players_list; public: diff --git a/Database.cpp b/Database.cpp index 6bb84ef..13358b3 100644 --- a/Database.cpp +++ b/Database.cpp @@ -11,11 +11,13 @@ #include "libsqlite.hpp" using namespace std; +// Calling database class Database::Database() { } +// function for displaying user information - Suraj void Database::database_queries() { //open database @@ -30,7 +32,8 @@ void Database::database_queries() } -/* void Database::add_players_db() +// function for writing player information to database - Suraj +void Database::add_players_db() { try { @@ -39,13 +42,18 @@ void Database::database_queries() int shooting, dribbling, guarding, stamina, acceleration, height; auto cur = db.get_statement(); - cur->set_sql( "INSERT INTO staff (forename, surname, job) " - "VALUES (?, ?, ?);" ); + cur->set_sql( "INSERT INTO USERPLAYERS (name, shooting, dribbling, guarding, stamina, acceleration, height) " + "VALUES (?, ?, ?, ?, ?, ?, ?);" ); cur->prepare(); - cur->bind( 1, forename ); - cur->bind( 2, surname ); - cur->bind( 3, job ); + cur->bind( 1, name ); + cur->bind( 2, shooting ); + cur->bind( 3, dribbling ); + cur->bind( 4, guarding ); + cur->bind( 5, stamina ); + cur->bind( 6, acceleration ); + cur->bind( 7, height ); + cur->step(); } @@ -55,5 +63,5 @@ void Database::database_queries() return 1; } return 0; -} */ +} diff --git a/Database.h b/Database.h index 2505096..cfae506 100644 --- a/Database.h +++ b/Database.h @@ -14,6 +14,9 @@ #include using namespace std; +/* This class is for creating functions to communicate with the database - Suraj */ + +// - Suraj class Database { public: diff --git a/Menu.cpp b/Menu.cpp index fdc2eb0..947eb1f 100644 --- a/Menu.cpp +++ b/Menu.cpp @@ -20,7 +20,7 @@ Menu::Menu() } -//object method for first menu display +//object method for first menu display - Suraj void Menu::display_Menu() { cout << "|----------------------------------------------------------------------|" << endl; @@ -29,7 +29,7 @@ void Menu::display_Menu() cout << "" << endl; } -// object method for first menu screen +// object method for first menu screen - Suraj int Menu::first_Menu() { Login set_user_credentials; @@ -64,6 +64,7 @@ int Menu::first_Menu() return 0; } +// Second menu screen - Suraj int Menu::second_Menu() { string user_team; diff --git a/Menu.h b/Menu.h index ad3061c..64c67f5 100644 --- a/Menu.h +++ b/Menu.h @@ -15,7 +15,7 @@ using namespace std; -// creating menu class +// creating menu class - Suraj class Menu { private: diff --git a/NewScreen.cpp b/NewScreen.cpp index 9b936a3..11f6305 100644 --- a/NewScreen.cpp +++ b/NewScreen.cpp @@ -12,12 +12,15 @@ //#include using namespace std; + +// Suraj NewScreen::NewScreen() { } +// Fuaction for clearing screen - Suraj void NewScreen::clear_screen() { - //clrscr(); + clrscr(); } diff --git a/NewScreen.h b/NewScreen.h index 67e5069..063963a 100644 --- a/NewScreen.h +++ b/NewScreen.h @@ -14,6 +14,8 @@ #include //#include +/* class for clearing screen - Suraj */ + using namespace std; diff --git a/login.cpp b/login.cpp index 054fe89..679ed4e 100644 --- a/login.cpp +++ b/login.cpp @@ -9,15 +9,17 @@ #include using namespace std; +// calling login class - Suraj Login::Login() { } -// object method for setting user login details +// object method for setting user login details - Suraj void Login::set_user_credentials() { + // function for writing username/password to veactor - Suraj string users_name, users_password; int x=1; while(x>0) @@ -51,7 +53,7 @@ void Login::set_user_credentials() } } -// object method for checking user credentials +// object method for checking user credentials - Suraj void Login::check_user_credentials() { string users_name, users_password; diff --git a/login.h b/login.h index a99c061..9d9da70 100644 --- a/login.h +++ b/login.h @@ -12,13 +12,13 @@ using namespace std; // Copyright © 2020 Suraj Mann. All rights reserved. // -/** To create user login **/ +/** To create user login - Suraj **/ -//declaring class for user login +//declaring class for user login - Suraj class Login { -// sensitive data being stored as private variables +// sensitive data being stored as private variables - Suraj private: std::string userName; std::string password;