reCT

The only ByteSpace Project big enough to have its
own Website

Inheriting Classes

Inheriting Classes are Classes that use an Abstract Class as a "blueprint". A Class can inherit from an Abstract class by including the name of the Abstract Class after the classname in parenthesis.
Heres an example:

class someInheritingClass (someAbstractClass) { ... }

Virtual Functions and Variables registered in the base-class will automatically be available in this Class as well, they are also able to be overwritten.


Sidenote: Constructors

If youre using Constructors in your Classes you will have to call your base-class' Constructor inside your Constructor. This can be done with the "base" statement. And should (preferably) be done as the first action inside the Constructor.

abs class someAbstractClass
{
  function Constructor() { ... }
}

class someInheritingClass (someAbstractClass)
{
  function Constructor()
  {
    base();
    ..
  }
}

Overwriting Virtual Functions and Variables

Now finally we get to the cool part: overwriting! Overwriting in ReCT is super simple, just use the "ovr" keyword like in this example:

abs class someAbstractClass
{
  virt set someVariable <- "some Value";
  virt set function someFunction() { ... }
}

class someInheritingClass (someAbstractClass)
{
  ovr set someVariable <- "some different Value";
  ovr set function someFunction { ... different code ... }
}