as in Javascript
example?:
PHP Code:
function onCreated()
{
this.var = 0;
watch( this.name @ ".var" );
this.var = 3; // echos: this.var changed from 0 to 3
}
function onVarChanged( strName, oldVar, newVar )
{
echo( strName SPC "changed from" SPC oldVar SPC "to" SPC newVar );
}
Usage:
PHP Code:
function onCreated()
{
watch( "clientr.health" );
}
function onVarChanged( strName, oldVar, newVar )
{
if ( strName == "clientr.health" )
{
Health_Bar.width = newVar;
// Effects, such as (newVar - oldVar) popping over the head to indicate damage
}
}
Outcome: Reduces Lag ( due to not requiring timeout's to check the change )
More Event-Driven systems