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

[NEW OSL] Classes #103

Open
Mistium opened this issue Mar 28, 2024 · 1 comment
Open

[NEW OSL] Classes #103

Mistium opened this issue Mar 28, 2024 · 1 comment
Assignees
Labels
Backburner Not happening for a while OSL

Comments

@Mistium
Copy link
Owner

Mistium commented Mar 28, 2024

class "player(id, position, money)" (
  self.test(this.input) = (
    return this.input == "test"
  )
)

P1 = new player("1",0,0)

log P1.test("test")

Static

class "Test()" (
  static.hello() = (
    return "world"
  )
  self.hello() = (
    return "originos"
  )
)
var test = new Test()
log Test.hello()
// its on the class! (logs world)
log test.hello()
// but on the instance its what we added :sunglasses: (logs originos)
// as an object
"Test":{
  "hello": {
    "main": {
      "inputs": {},
      "code": [
        "return \"world\""
      ]
    },
    "inst": {
      "inputs": {},
      "code": [
        "return \"originos\""
      ]
    }
  }
}
@Mistium Mistium changed the title [Suggestion] Classes in osl [Suggestion] Classes In OSL Apr 7, 2024
@Mistium Mistium self-assigned this May 6, 2024
@Mistium Mistium added Backburner Not happening for a while OSL labels May 6, 2024
@Mistium
Copy link
Owner Author

Mistium commented May 9, 2024

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 🤷‍♀️

@Mistium Mistium changed the title [Suggestion] Classes In OSL [NEW OSL] Classes May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backburner Not happening for a while OSL
Projects
None yet
Development

No branches or pull requests

1 participant