[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: transparent manipulation of C data
- From: Tim Conkling <tconkling@...>
- Date: Wed, 22 Oct 2003 23:26:33 -0400
Well, I figured that __newindex would get called every time one of the
"special" table keys is mutated because I don't call rawset on the
table in that case. Similarly, __index would be called every time one
of these keys was accessed, and rawget would not be called as a result.
The reason I can't store copies of values like "speed" that are stored
in the corresponding C++ object is because these may be further
manipulated by the engine (for example, speed may be set to 0
automatically if the sprite bumps into a barrier).
On Oct 22, 2003, at 9:23 PM, Nick Trout wrote:
Just a note in case you get stuck: new index will only fire the first
time set is called so you need to attach the metamethods to a proxy
table (which remains empty) and all the values go in a seperate values