From bca429dd94dafc49cf9134040dfdfb6baf0de10c Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Sat, 22 Mar 2025 21:41:50 +0000 Subject: Add basic item system --- item.rhm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 item.rhm (limited to 'item.rhm') 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) -- cgit v1.2.3