About Social Code
summaryrefslogtreecommitdiff
path: root/src/item.rhm
blob: 6716dbcb70e276b083a8a740ffe431885231c07a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)