-
-
Save GarryMoveOut/58e2d0550fb387c977b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "baza.h" | |
baza::baza(int _zycie, string _opis) | |
:zycie(_zycie) | |
,opis(_opis) | |
{ | |
zycie = _zycie; | |
opis = _opis; | |
} | |
baza::~baza(void) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <string> | |
using namespace std; | |
class baza | |
{ | |
public: | |
int zycie; | |
string opis; | |
baza(int _zycie, string _opis); | |
~baza(void); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "gracze.h" | |
gracze::gracze(int _z, string _o, int _atak, string _okrzyk) | |
:baza(_z, _o) | |
,atak(_atak) | |
,okrzyk(_okrzyk) | |
{ | |
atak = _atak; | |
okrzyk = _okrzyk; | |
} | |
gracze::~gracze(void) | |
{ | |
} | |
int gracze::pokaz_zycie() | |
{ | |
return zycie; | |
} | |
string gracze::krzyki() | |
{ | |
return okrzyk; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "baza.h" | |
#include <string> | |
class gracze: | |
public baza | |
{ | |
public: | |
int atak; | |
string okrzyk; | |
//int zycie; | |
//string opis; | |
gracze(int _zycie, string _opis, int _atak, string _okrzyk); | |
~gracze(void); | |
int pokaz_zycie(); //metoda zwracajaca zycie | |
string krzyki(); //metoda zwracajaca okrzyk | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "przeszkody.h" | |
przeszkody::przeszkody(int _opor, int _wielkosc) | |
:baza(zycie, opis) | |
{ | |
opor = _opor; | |
wielkosc = _wielkosc; | |
} | |
przeszkody::~przeszkody(void) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "baza.h" | |
class przeszkody | |
:public baza | |
{ | |
public: | |
int opor; | |
int wielkosc; | |
przeszkody(int _opor, int _wielkosc); | |
~przeszkody(void); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
//nagłówki klas | |
#include "baza.h" | |
#include "gracze.h" | |
#include "przeszkody.h" | |
int main() | |
{ | |
baza player1(100,"gracz1"); | |
cout<<"player zycie"<<endl; | |
cout<<player1.zycie<<endl; | |
//utworzenie gracza | |
gracze gracz(90, "foo", 10, "hurra"); | |
cout<<"gracz zycie wartosc"<<endl; | |
cout<<gracz.zycie<<endl; | |
cout<<"player zycie"<<endl; | |
cout<<player1.zycie<<endl; | |
cout<<"player opis"<<endl; | |
cout<<player1.opis<<endl; | |
cout<<"gracz opis"<<endl; | |
cout<<gracz.opis<<endl; | |
cout<<"gracz ataak"<<endl; | |
cout<<gracz.atak<<endl; | |
cout<<"gracz okrzyk"<<endl; | |
cout<<gracz.okrzyk<<endl; | |
system("Pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment