diff options
author | Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> | 2025-03-22 21:41:50 +0000 |
---|---|---|
committer | Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> | 2025-03-22 21:41:50 +0000 |
commit | bca429dd94dafc49cf9134040dfdfb6baf0de10c (patch) | |
tree | a2a63bc9fb584622156f268dd71f94424819461d /item.rhm | |
parent | cb01f1f6f930cee6529e51dc3d29945edaa9d95a (diff) |
Add basic item system
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) |