mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* Add escript guide docs for classes * Add ClassInstanceRef to objref docs * Use objref.dot to generate svg
21 lines
452 B
Text
21 lines
452 B
Text
class Colorable()
|
|
function Colorable( this, color )
|
|
this.color := color;
|
|
endfunction
|
|
endclass
|
|
|
|
class Drawable()
|
|
function Drawable( this, x, y )
|
|
this.x := x;
|
|
this.y := y;
|
|
endfunction
|
|
endclass
|
|
|
|
class GreenShape( Colorable, Drawable )
|
|
function GreenShape( this )
|
|
super( color := "green", x := 10, y := 20 );
|
|
endfunction
|
|
endclass
|
|
|
|
var shape := GreenShape();
|
|
print( $"{shape.color} {shape.x} {shape.y}" ); // Output: green 10 20
|