説明
IsClassDerivedFrom 関数は、クラスが別のクラスから派生されているかどうかを示す boolean 値を返します。
引数
- string:
この文字列は、別のクラスから派生する可能性のあるクラス名である必要があります。
- string:
この文字列は、基本クラスとなる可能性のあるクラス名である必要があります。
戻り値
- boolean:
クラスが基本クラスから派生したものであるかどうかを示します。
例
クラスが別のクラスから派生しているかどうかを確認し、有用なフィードバックを返します。
|
return function() local derivedName = "World" local baseName = "Group" local isDerived = IsClassDerivedFrom(derivedName, baseName) if isDerived then Printf(derivedName .. " is derived from " .. baseName) else Printf(derivedName .. " is not derived from " .. baseName) end end |