Skip to content
Permalink
Browse files
Commit 2
  • Loading branch information
manns18 committed Mar 20, 2020
1 parent 8543e4f commit 6fe9f288d64b8abfb86f065fc844385836015ef3
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 17 deletions.
@@ -1,4 +1,3 @@
//
// CreateTeam.cpp
// BasketBallGame
//
@@ -10,19 +9,23 @@
#include <iostream>
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<number_of_players; i++)
{
@@ -13,9 +13,14 @@
#include <vector>
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<std::string> players_list;

public:
@@ -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;
} */
}

@@ -14,6 +14,9 @@
#include <iostream>
using namespace std;

/* This class is for creating functions to communicate with the database - Suraj */

// - Suraj
class Database
{
public:
@@ -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;
2 Menu.h
@@ -15,7 +15,7 @@
using namespace std;


// creating menu class
// creating menu class - Suraj
class Menu
{
private:
@@ -12,12 +12,15 @@
//#include <conio.h>
using namespace std;


// Suraj
NewScreen::NewScreen()
{

}

// Fuaction for clearing screen - Suraj
void NewScreen::clear_screen()
{
//clrscr();
clrscr();
}
@@ -14,6 +14,8 @@
#include <stdio.h>
//#include <conio.h>

/* class for clearing screen - Suraj */

using namespace std;


@@ -9,15 +9,17 @@
#include <string>
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;
@@ -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;

0 comments on commit 6fe9f28

Please sign in to comment.