D
Daniel Cook
Guest
Hey everyone,
I am working on an item system in a game and have run into a bit of a snag.
The jist of it is this, i have created an Enum to hold a Int value for every item within my game:
enum ItemIndex{
Then i held specifice data abount my items within an array. then by using there Enum value i can get the relivent data from the array.
stackCapacity[ItemIndex.gun] = 1;
stackCapacity[ItemIndex.sword] = 1;
stackCapacity[ItemIndex.healthPotion] = 5;
So that works just fine, however I recently descoved Macros, seeing as how there value will never need to change I figured it would be better to have them stored as a constant value. But i can't seem to make a constant Array with this code.
#macro stackCapacity[1] 1
Am i doing something wronge? or can you not create marco arrays? and if not what is the best way to create a constant array?
thanks for reading.
I am working on an item system in a game and have run into a bit of a snag.
The jist of it is this, i have created an Enum to hold a Int value for every item within my game:
enum ItemIndex{
gun = 0,
sword = 1,
healthPotion = 10,
ect...
}sword = 1,
healthPotion = 10,
ect...
Then i held specifice data abount my items within an array. then by using there Enum value i can get the relivent data from the array.
stackCapacity[ItemIndex.gun] = 1;
stackCapacity[ItemIndex.sword] = 1;
stackCapacity[ItemIndex.healthPotion] = 5;
So that works just fine, however I recently descoved Macros, seeing as how there value will never need to change I figured it would be better to have them stored as a constant value. But i can't seem to make a constant Array with this code.
#macro stackCapacity[1] 1
Am i doing something wronge? or can you not create marco arrays? and if not what is the best way to create a constant array?
thanks for reading.