in main? or in the prototyp? if in main, then yes i did, i put my code in another project file to make it easier to work with
Main.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include <iostream>
#include "PlayerClass.h"
using namespace std;
Player::Player(int MONEY, std::string NAME, int EXPERIENCE,
int ACCOUNTSHACKED, int PASSWORDCRACKERLVL,
int DECRYPTIONTOOLLVL, int PASSWORDCRACKERPRICE,
int DECRYPTIONTOOLPRICE, bool PLR_INVENTORY[2]): money(MONEY), name(NAME),
experience(EXPERIENCE),
accountsHacked(ACCOUNTSHACKED),
PasswordCrackerLvl(PASSWORDCRACKERLVL),
DecryptionToolLvl(DECRYPTIONTOOLLVL),
PasswordCrackerPrice(PASSWORDCRACKERPRICE),
DecryptionToolPrice(DECRYPTIONTOOLPRICE),
plr_inventory(PLR_INVENTORY[0], PLR_INVENTORY[1]){}
Player::~Player(){}
int main()
{
Player pc(1200, "Default", 0, 0, 1, 1, 100, 150, {false, false});
pc.start();
}
|
PlayerClass.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#ifndef PLAYERCLASS_H_INCLUDED
#define PLAYERCLASS_H_INCLUDED
#include <string>
#include <vector>
class Player
{
public:
Player(int MONEY, std::string NAME, int EXPERIENCE,
int ACCOUNTSHACKED, int PASSWORDCRACKERLVL,
int DECRYPTIONTOOLLVL, int PASSWORDCRACKERPRICE,
int DECRYPTIONTOOLPRICE, bool PLR_INVENTORY[]
);
~Player();
void gameStart();
void save();
void load();
void startup();
int mainGame();
void accountNumbers();
void shop();
void cheats();
void playerInfo();
void hackBank();
void upgrades();
void alabamaBank();
void hackingMethod();
private:
int money;
std::string name; //The player will enter their name so name will not be constant
bool isFirstStartup;
std::vector<std::string> createNumberList;
std::vector<std::string> bankList;
std::vector<float> bankAccounts; //this stores the money in the list.
int experience;
int accountsHacked;
int PasswordCrackerLvl;
int DecryptionToolLvl;
int PasswordCrackerPrice;
int DecryptionToolPrice;
bool plr_inventory[];
};
#endif // PLAYERCLASS_H_INCLUDED
|
errors
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp||In constructor 'Player::Player(int, std::string, int, int, int, int, int, int, bool*)':|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|16|error: expression list treated as compound expression in mem-initializer [-fpermissive]|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|16|warning: value computed is not used [-Wunused-value]|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|16|warning: left operand of comma operator has no effect [-Wunused-value]|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|16|error: incompatible types in assignment of 'bool' to 'bool [0]'|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp||In function 'int main()':|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|23|warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|23|error: no matching function for call to 'Player::Player(int, const char [8], int, int, int, int, int, int, <brace-enclosed initializer list>)'|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|23|note: candidates are:|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|6|note: Player::Player(int, std::string, int, int, int, int, int, int, bool*)|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|6|note: no known conversion for argument 9 from '<brace-enclosed initializer list>' to 'bool*'|
C:\Users\Chay Hawk\Desktop\Modular testing\PlayerClass.h|7|note: Player::Player(const Player&)|
C:\Users\Chay Hawk\Desktop\Modular testing\PlayerClass.h|7|note: candidate expects 1 argument, 9 provided|
C:\Users\Chay Hawk\Desktop\Modular testing\main.cpp|25|error: 'class Player' has no member named 'start'|
||=== Build finished: 4 errors, 3 warnings (0 minutes, 0 seconds) ===|