wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps
https://wurstlang.org
Apache License 2.0
224 stars 30 forks source link

compiletime getBuildMapData #878

Closed PhoenixZeng closed 4 years ago

PhoenixZeng commented 5 years ago

in wurst.build

---
projectName: "foo"
dependencies:
- "https://github.com/wurstscript/wurstStdlib2"
buildMapData:
  name: "foo"
  fileName: "foo"
  author: "foo"
  playerCount: 5
  someInt: 5//custom
  someTip:"hello world" //custom

new compiletime MagicFunctions getBuildMapData*type*(string)->*type*

int version = compiletime(getBuildMapDataInt("someInt"))
var tip = compiletime(getBuildMapDataString("someTip"))

init
    print(version)
    print(tip)
peq commented 5 years ago

Hmm, I don't understand the benefit of custom properties in wurst.build -- you could just use normal constants to store this information. Getting the value for the builtin types might be useful though.

PhoenixZeng commented 4 years ago

well . it looks like useless