IsClassDerivedFrom(string, string)
Description
Section titled âDescriptionâThe IsClassDerivedFrom Lua function returns a boolean indicating if a class is derived from a different class.
Arguments
Section titled âArgumentsâ- String:
This string needs to be the name of the class that might be derived from a different class. - String:
This string needs to be the name of the class that might be the base class.
- Boolean:
The returned boolean indicates if the class is derived from the base class.
Example
Section titled âExampleâThis example checks if a class is derived from a different class and returns useful feedback.
| Copy CodeLua |
| ``` |
| return function() |
-- Set the value of the two strings.local derivedName = "World"local baseName = "Group"-- Check if the derivedName is the name of a class derived from the baseName class.local isDerived = IsClassDerivedFrom(derivedName, baseName)-- Provide feedback.if isDerived then Printf(derivedName .. " is derived from " .. baseName)else Printf(derivedName .. " is not derived from " .. baseName)endend