DRLA-RPG/ZScript/Util.zs

23 lines
510 B
Plaintext
Raw Permalink Normal View History

2019-04-05 19:02:56 -07:00
class Type abstract
{
static clearscope bool ClassExists(string className)
{
Class type = className;
return type != null;
}
static clearscope bool IsSubclass(string className, string parentName)
{
Class parent = parentName;
Class type = className;
return (parent && type) ? type is parent : false;
}
static clearscope bool ObjectIs(Object o, string className)
{
return ClassExists(className) ? o is className : false;
}
}