Hey Guys,
I am working on building a simple inventory system
I made an item class:
public class GameItem {
var ItemName : String;
var ItemId : int;
var ItemIcon : Texture2D; //2d picture for GUI...GUI Icon
var ItemType : itemtype; //note the case here
var Equipped : boolean;
var itemValue : int;
var itemteigue : int;
}
enum itemtype{
weapon,
food,
potion,
misc,
tools
}
enum potiontype{//lists out all the different item types
fire1,
fire2,
fire3
}
And I figured I would then make up arrays of this item to track what the user has. My question is lets say I have a game object that is a Sword. How would I go about setting its values for my item class before hand (such as damage, health, itemID, ItemIcon) as each of those would be specifc for each different item…
Aslo when declaring a class are you not allowed to put in if(){} statements?
Thanks!