Mistium / Origin-OS

originOS is a scratch desktop gui made by @Mistium
https://origin.mistium.com
24 stars 9 forks source link

[NEW OSL] Classes #103

Open Mistium opened 3 months ago

Mistium commented 3 months ago
class “player” (

  methods = [
    "init",
    "test"
  ]

  def "init()" "id, position, money"
    player = {}
    player."id" = id.str
    player."position" = position.int
    player."money" = money.int
  endef

  def "test()" "input"
    return input == "test"
  endef

)

P1 = player.init("1",0,0)

log P1.test("test")
Mistium commented 1 month ago

Still unsure of the proper syntax to make this in osl, especially with the current parser, might be better off using the compiler system somehow, maybe use a json object 🤷‍♀️