Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <time.h>
- #include <dos.h>
- #include "Manager.h"
- #include "Soldier.h"
- using namespace std;
- int main()
- {
- srand ( time(NULL) );
- string str;
- Team team;
- Manager manager;
- manager.info();
- //getline(cin, str);
- //manager.getFunction(str);
- cout << "Game over!" << endl;
- return 0;
- }
- #ifndef MANAGER_H
- #define MANAGER_H
- #include <iostream>
- #include <string>
- #include <cstring>
- #include <stdio.h>
- #include <malloc.h>
- using namespace std;
- class Team;
- class Manager
- {
- private:
- typedef struct
- {
- string name;
- int *adress;
- } DB;
- DB funcBase[19];
- string param = "Nike";
- public:
- Manager(){
- cout << "Welcome to the GAME!nEnter your command to your army!" << endl;
- funcBase[1].name = "addSoldier";
- //funcBase[1].adress = &Team::addSoldier();
- }
- int getFunction(string strng){
- char *str = new char[strng.length()];
- strcpy(str, strng.c_str());
- char *pos = strchr(str, ':');
- int piece_length = pos-str;
- char *str_action = new char[piece_length];
- strncpy(str_action,str, piece_length);
- str_action[piece_length] = '