In developing Conquer, I want to make an API for it so that people can write their own AI’s to play the game. I’ve had some fun with this in letting friends make their own AI’s and let them battle it out against each other to see who has the best one, but I want to make this a bit broader in scale.
The problem is I don’t want people to cheat, and I don’t want to have to dissect their code to make sure they’re not doing anything they shouldn’t be allowed to do. For example, I want people to be able to get the number of ships on a planet, but I don’t want them to be allowed to change it.
I assume the best way is to just put in getters and no setters to handle my problems, however, do they pose a performance problem? How much does the standard compiler optimize that? It’s very important to me that this runs very fast because the computations can run for sometimes upwards to 10 minutes. Is this the best way to go? Should I be worried about how that will mess with performance?