wowserhq / stormjs

StormLib for Javascript, powered by Emscripten
MIT License
14 stars 6 forks source link

Feature: file search #25

Closed fallenoak closed 6 years ago

fallenoak commented 6 years ago

First stab at searching. Open to suggestions on naming. Would search, searchFiles, or findFiles be better than find?

Closes #9

timkurvers commented 6 years ago

Hm, given MPQ.prototype.openFile, you might expect seeing File(s) in the method name for searching. I think this was one of the main reasons why Blizzardry currently has a files object, so that it doesn't get awkward with method names. I personally think search covers it pretty nicely., though.

While we're at it, can we move the MPQ.open method to a static method inside of the class? Or is there a reason it's living outside currently?

fallenoak commented 6 years ago

@timkurvers Renamed find to search!

Regarding MPQ.open: I think I missed the boat... did static functions show up in ES2015? I know static properties still are in proposal form, but after Googling a bit, it seems that maybe static functions are already a thing?

Edit: Apparently I knew they were a thing when I added a few to wowser-math. I need to remember to eat more fish. I'll tackle updating that in a separate commit on master.

timkurvers commented 6 years ago

No worries, excellent stuff 👍