Skip to content

[feature] Enums #29

Description

@nilq

Enums will be simple. My current idea is to have something like the following:

import enemies { Enemy }

Weapon: enum {
  Gun
  Swordfish
  Fist
}

damage_enemy_with: fun(enemy: Enemy, weapon: Weapon) {
  switch weapon {
    Weapon Gun => enemy damage(100)
    Weapon Swordfish => enemy damage(9000)
    Weapon Fist => enemy damage(10)
  }
}

Again; very simple. :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions