Skip to main content

Prevent Rhino scripts from accessing setters

No replies
sproketboy
Offline
Joined: 2006-08-07
Points: 0

Hi all,

I'm using a script engine in my game and I'm passing to the bindings some objects which I don't want modified. For example I don't want a script to do something like this:

player.name = "whatever";

So I created a ReadOnly interface for this object (getters only) which I pass to the bindings but the setters are still accessible.

Any ideas? Maybe the solution is to make a copy of the objects?