Create a new
This will not call the constructor. That is what the
Create a new
The vector3d class contains metamethods for operations such as vector scaling and dot product.
See also: Vector3d Class.
Checks if this
This is a method that all classes inherit, and not a function of the Class module. This means that you should call this on your classes with the ':' operator rather than trying to call class.is_a() itself.
@code() local Animal = class.new(); local Dog = Animal(); print(Dog:is_a(Animal)); -- This is valid print(Dog.is_a(Animal)); -- Not valid; must use ':' to call print(class.is_a(Dog)); -- Not valid; do not call class.is_a() directly @endcodeFor a more in-depth example and explanation, please see the classes page.
@code() -- Dog should be a child of Animal Animal = class.new(); Dog = Animal(); -- Banana should be a child of fruit Fruit = class.new(); Banana = Fruit(); print("Dog is an Animal?", Dog:is_a(Animal)); -- Should be true print("Banana is a Fruit?", Banana:is_a(Fruit)); -- Should be true print("Banana is an Animal?", Banana:is_a(Animal)); -- Should be false @endcodePage last updated at 2018-09-25 20:47:13