IsClassDerivedFrom(string, string)

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

説明

The IsClassDerivedFrom Lua function returns a boolean indicating if a class is derived from a different class.

引数

  • 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.

This example checks if a class is derived from a different class and returns useful feedback.

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