diff options
Diffstat (limited to 'item.rhm')
-rw-r--r-- | item.rhm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/item.rhm b/item.rhm new file mode 100644 index 0000000..6716dbc --- /dev/null +++ b/item.rhm @@ -0,0 +1,21 @@ +#lang rhombus/static + +export: + Item + Stack + ItemCap + item_get_cap + +enum Item: + bronze_axe + +enum ItemCap: + none + chop + +fun item_get_cap(item :: maybe(Item)) :: ItemCap: + match item: + | Item.bronze_axe: ItemCap.chop + | ~else: ItemCap.none + +class Stack(item :: Item, quantity :: Int) |