Posted 11 September 2004 - 02:07 AM
I think it would be great if AngelScript supported properties (a kind of variables, which are accessed via pair of Get/Set functions). The actual variable may not even exist at all.
Consider the following example:
Let's say we have an in-game console and player has a [limited] access to internal game variables. Wouldn't it be nicer to let him type like:
[CONSOLE] game.maxPlayers 32
when he wants to set the max number of players instead of clumsy
[CONSOLE] game.SetMaxPlayers( 32 )
Of course it is possible to export variable maxPlayers through RegisterObjectProperty(), but what if this variable is not allowed to be changed at any time (and/or some action is required to be taken upon its change)?