PHP Code:
/*
This is an object class meaning it needs to be joined to a prior created object such as a TStaticVar() or a weaponNPC.
And is called as such:
obj.(function right here without parenthesis)(params)
*/
public function hasFunc(func) {
if (func in this.getfunctions())
return true;
return false;
}
public function isDynamicFunc(func) {
if (func in this.getdynamicvarnames())
return true;
return false;
}
public function hasVar(var) {
if (var in this.getdynamicvarnames()) {
if (isValidVar(var))
return true;
}
return false;
}
public function isValidVar(var) {
if (this.(@ var) != null)
return true;
return false;
}
Hopefully, these will make it easier for scripters here and there to code their systems with ease and not get confuse when doing a crap load of var checks, and etc etc.
I often get confused when doing a crapload of checks and I've always found it easier to do:
PHP Code:
if (!obj.hasVar(var))
continue;
As opposed to:
PHP Code:
if (obj.(@ var) == null)
continue;
I think it looks nicer/neater but maybe I'm just being picky. Use as you feel necessary.