Skip to content

Abstracts

Kriptel edited this page Dec 30, 2024 · 1 revision

Abstracts in script

In the any classpath you can add RuleScriptAbstracts.txt (or define rulescript_abstracts_file_path value) file.

Enter the type path of abstracts there.

Example:

RuleScriptAbstracts.txt

test.HelloWorldAbstract.LocalAbstract
test.HelloWorldAbstract
TestAbstract

Meta

@:alias(path:String,?fullPath:Bool = false)

Sets a different type path for the abstract in scripts.

Example:

Source

package test.TestAbstract;

@:alias('hello.TestAbstract', true)
abstract TestAbstract(Test) from Test to Test
{
	public static inline var helloworld:Int = 1;
}

Script:

hello.TestAbstract.helloworld; // 1

@:ignoreField

Ignores field.

Example:

Source

abstract TestAbstract(Test) from Test to Test
{
	@:ignoreField
	public static inline var helloworld:Int = 1;
}
Clone this wiki locally