Kaba class Rect ed

...

Syntax ed

class Rect
    var x1: f32
    var x2: f32
    var y1: f32
    var y2: f32

    # constructors
    func mut __init__(x1: f32, x2: f32, y1: f32, y2: f32)
    func mut __init__(p00: vec2, p11: vec2)

    # functions
    func pure area() -> f32
    func pure center() -> vec2
    func pure grow(d: f32) -> Rect
    func pure height() -> f32
    func pure inside(p: vec2) -> bool
    func pure p00() -> vec2
    func pure p11() -> vec2
    func pure size() -> vec2
    func pure width() -> f32

    # operators
    func pure __str__() -> string        # str(Rect) -> string
    func mut __assign__(b: Rect)         # Rect = Rect
    func pure __eq__(b: Rect) -> bool    # Rect == Rect -> bool
    func pure __neq__(b: Rect) -> bool   # Rect __neq__ Rect -> bool

    # constants
    let EMPTY: Rect
    let ID: Rect
    let ID_SYM: Rect

Functions ed

func pure area() -> f32
...

func pure center() -> vec2
...

func pure grow(d: f32) -> Rect
...

func pure height() -> f32
...

func pure inside(p: vec2) -> bool
...

func pure p00() -> vec2
...

func pure p11() -> vec2
...

func pure size() -> vec2
...

func pure width() -> f32
...

Elements ed

var x1: f32
...

var x2: f32
...

var y1: f32
...

var y2: f32
...