Closed Simba98 closed 5 years ago
Instead, I'd prefer if you simply expose the info call as seen here: https://github.com/TeamOpenIndustry/ImmersiveRailroadingIntegration/blob/forge_1.12.2/src/main/java/cam72cam/immersiverailroading/thirdparty/CommonAPI.java#L53
You can see how this is done for the detector here: https://github.com/TeamOpenIndustry/ImmersiveRailroadingIntegration/blob/forge_1.12.2/src/main/java/cam72cam/immersiverailroading/thirdparty/opencomputers/AugmentDriver.java#L134
Well, it is a solution. The info() call expose all of properties. However, Lua scripts have to get all properties even if we just need one property. It may reduce the whole efficiency, and lag the server. What if we add a info(String property) call to increase that process? It receive a string that is property name and return the property requested.
That's a good idea, I like it!
Alright~ I'll do it later~ And make a new pull request for new idea.
But now it have a question: how can I deal with old 'get' APIs? Like getPos, getTag? Keep it for compatibility? Merge it into new property API? Or offer two ways to get Pos and Tag, etc. (Both new property API and old get series API can be used) I want to know your Design Philosophy, Thanks~.
In my server, my high-speed railway system have an issue with getting the speed of locomotive. So I would suggest you add this API to OpenComputers Lua Script. Maybe my code style don't match yours, please also help to change it.