Basics/Class.lua

This is a WRS-specific implementation which allows it to use a table as class, and to utilize inheritance.

 

Class(baseClass, parentClass)

This function makes baseClass (table) a class which can, but does not have to inherit from another class (parentClass, table or nil).

If your class is named e.g. MyClass, you can then create instances of your new class by calling local myInstance = MyClass:new(). This will create a new instance of your class, and it will automatically call MyClass:load() on the new instance.

  30  function Class(baseClass, parentClass) 

ExtensionOf(parent)

This creates and returns a new table which inherits from parent (table), but does not use an instancing system. Use this if you want to have VehicleScripts inheriting from each other.

 109  function ExtensionOf(parent) 

All contents of this page may be used for modding use for Winter Resort Simulator - Season 2 only. Any use exceeding this regulation is not permitted.

Copyright (C) HR Innoways, 2021. All Rights Reserved.