Hmm, ok thanks.
Type: Posts; User: ExDHaos
Hmm, ok thanks.
well i meant stuff like the fact that there shouldn't be more then 2 side-effect in a function(or something like that)
Is there some book that doesn't teach C++ but only different C++ rules?
the purpose is just to add item to inventory
oh yeah, thanks for remaining, i was planning to write the code for that but i guess i forgot
for( int iii=0; iii <= MAX_INV; iii++)
if ( iii...
void AddItem(int A) //the arug' the amount you want to add
{
int B; //used to contain the subscribed amount
...
void AddItem(int A)
{
int B;
amount += A;
if( amount < stackSize )
{
B = amount - stackSize;
GetItem(B)
}
void AddItem(int A)
{
int B;
amount += A;
if( amount < stackSize )
{
B = amount - stackSize;
Hehe, thanks.
i don't get the static part
void GetItem()
{
for (int iii=0; iii!=MAX_INV; iii++)
if (charInv[iii].id==0){ charInv[iii] = *this); break;}
else if (charInv[iii].id==id)
if (amount < stackSize){ amount++;...
#include <string>
#include <iostream>
using std::string;
using std::cout;
using std::endl;
#define MAX_ITEMS 100
#define MAX_INV 30
class Items
A.primDmg = B.primDmg;
A.sconDmg = B.sconDmg;
A.resist = B.resist;
A.bnsOpt = B.bnsOpt;
well those r arrays, how can assign array to array?
void copy(Items &A, Items B)
{
ID.A = ID.B;
mainClass.A = mainClass.B;
subClass.A = subClass.B;
strReq.A = strReq.B;
chkReq.A = chkReq.B;
quality.A = quality.B;...
hmm, ok thanks
is there some special way to copy class object to another object of the same class? or am i forced to do operator overloading for that one?
well i think i will change it to 0 then (tho i always loved the NULL keyword)
hmm i guess ill use it then, it makes more sense, well thanks for the help, I really appreciate it.
well if it is the same as 0 its ok
oh, then maybe its just some little typo i had
the value is not user-input, its a fixed value, so theres no need to do the assert IMO
the double value id...
well i did something like that in the past but i didn't like the fact that i had to use multiple functions for one object, and is it the only thing i should improve?
#include <string>
#include <vector>
using std::string;
using std::vector;
using std::cout;
using std::endl;
#define MAX_ITEMS 100
#define MAX_INV 30
Oh nevermind, it seems like I made some little mistake when I tried to define everything outside the class, thanks alot for the help.
But I said, even when I declared them outside the constructor I had the same problem.
#include <string>
#include <vector>
using std::string;
using std::vector;
using std::cout;
using std::endl;
#define MAX_ITEMS 100
#define MAX_INV 30
Well I know that. But nevermind, I thought there supposed to be a special way too initialize class vector objects.
void LoadRaces()
{
vector<Races>racesDB;
racesDB.push_back(Races(1,...
}classesDB[MAX_CLASSES], *charClass;
void LoadClasses()
{
classesDB[0].classInfo(3, "Warrior", 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5);
}
I'm trying to do this but...
no, like something i tried in the code