SFML community forums

Help => General => Topic started by: Santa-Claus on April 05, 2014, 02:42:13 pm

Title: [SOLVED]Need some help with structs or classes.
Post by: Santa-Claus on April 05, 2014, 02:42:13 pm
Hello everyone,

So i have a question how would i be able to do something like the following in C++ (using structs or classes) (Code example is visual basic)
Code: [Select]
Private Type BankRec
    Item(1 To MAX_BANK) As PlayerInvRec
End Type
I'm pretty new to C++ and used to use visual basic..... but in visual basic you don't have all the same possibilities and especially not in VB6.0

Kind Regards,
Santa-Claus,
Title: Re: Need some help with structs or classes.
Post by: eike on April 05, 2014, 03:20:08 pm
I don't know VB, but have a look at "enum". How do you think about a C++ book?  ;)

Title: Re: Need some help with structs or classes.
Post by: Santa-Claus on April 05, 2014, 03:26:56 pm
And i am actually reading a book atm :p
Just don't find how to do this
I'm actually not looking for enums :(
That's more for item rarity or tile attributes or anything like that.

I think i'm gonna use classes :)

Code: [Select]
class Inventory {
public:
Inventory();
struct slot
{
int ItemNumber;
int Amount;
};
private:
int Max_Slots;
};

€dit: found it.

King Regards,
Santa-Claus,