#include <iostream>
#include <cmath>
#include <windows.h>
#include <cstdlib>
#include <ctime>
#include <string>
#include <cstdio>
#include<conio.h>
using namespace std;
int losowanie(int a){
srand(time(NULL));
return rand()%a;
}
void tekst(string a, int b){
for(int i=0;i<a.length();i++){
cout<<a[i];_sleep(b);
}
}
class item{;
friend class postac;
public:
char numer[1];
string nazw;
int ID;
char cel;
int waga;
int cena;
int attack;
int defensywa;
int obrona;
int hp;
int mana;
item(char nazwa1, int id, char why,int weight, int a=0, int ob=0,int def=0, int p=0,int h=0, int m=0){
nazw=nazwa1;
ID=id;
numer[ID]=nazwa1;
cel=why;
waga=weight;
attack=a;
obrona=ob;
defensywa=def;
cena=p;
hp=h;
mana=m;
}
};
class postac
{
friend class item;
public:
int bron_biala;
int bron_dystans;
int wartosc_czarow;
string imie;
int eq[100];
int miecz;
int tarcza;
int luk;
int attack;
int obrona;
int defensywa;
int exp;
int hajs;
int hp;
int masa;
postac(string imi,int reczna =0,int luki=0,int czary=0,int weight=0)
{
imie=imi;
bron_biala=reczna;
bron_dystans=luki;
wartosc_czarow=czary;
masa=weight;
}
public:
void item_add( int id){
int m;
char przedmiot;
przedmiot = item ::numer[id];
for(int i=0;i<100;i++){
if (postac ::eq[i]==0){
postac :: eq[i]=id;
if (masa+(char przedmiot).waga>100){
cout<<imie;
string kwestja;
kwestja ="Nie dam rady tyle podniesc";
tekst(kwestja,60);
}
else
masa=masa+(przedmiot).waga;
i=101;
}
czy taka konstrukcja (string a).waga ma prawo dzialac a jesli nie to jak moge inaczej rozwiazac ten problem?