Hi,
I was wondering whether I could use an enumeration which is defined in another class. I want to define an item to pickup and use an enumeration to specify it:
Now I'd like to use this enum in my inventory class, and be able to say:
But I can't come up with a way to 'share' the enum type. Has it something todo with .int and .ucl files maybe?
Thanks in advance.
I was wondering whether I could use an enumeration which is defined in another class. I want to define an item to pickup and use an enumeration to specify it:
Code:
class ItemPickup extends Pickup;
// Possible Items
enum ItemType {
ItemA,
ItemB
};
// Editable from Properties Screen
var () ItemType itemType;
defaultproperties {
itemType=ItemA
InventoryType=Game.Item
DrawType=DT_StaticMesh
}
Now I'd like to use this enum in my inventory class, and be able to say:
Code:
class Item extends Inventory;
// Item type from ItemPickup
// ** DOES NOT COMPILE, but I'd like to do something like this. **
var ItemPickup.ItemType itemType;
function bool HandlePickupQuery( pickup Item ) {
if ( class == item.InventoryType ) {
// Copy the value here.
itemType = (ItemPickup(item).itemType);
return true;
}
return Inventory.HandlePickupQuery(Item);
}
But I can't come up with a way to 'share' the enum type. Has it something todo with .int and .ucl files maybe?
Thanks in advance.