IsClassDerivedFrom(string, string)

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » IsClassDerivedFrom(string, string)
Version 2.2

説明

IsClassDerivedFrom 関数は、クラスが別のクラスから派生されているかどうかを示す boolean 値を返します。

引数

  • string:
    この文字列は、別のクラスから派生する可能性のあるクラス名である必要があります。
  • string:
    この文字列は、基本クラスとなる可能性のあるクラス名である必要があります。

戻り値

  • boolean:
    クラスが基本クラスから派生したものであるかどうかを示します。

クラスが別のクラスから派生しているかどうかを確認し、有用なフィードバックを返します。

Lua
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)
end
end