Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Enums #29

Open
nilq opened this issue Jul 5, 2020 · 0 comments
Open

[feature] Enums #29

nilq opened this issue Jul 5, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@nilq
Copy link
Member

nilq commented Jul 5, 2020

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. :)

@evolbug evolbug added the enhancement New feature or request label Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants