#include <oxstd.h>


class Line                        // Line is the class name
{
    decl x, y;                          // two data members
    const decl origin;                 // const data member
    static decl cLines;               // static data member
    Line(const orig);                        // constructor
    moveto(const x, const y);                // move cursor
    lineto(const x, const y);  // draw line and move cursor
    static getcLines();                  // static function
    static setcLines(c);                 // static function
};                      // ; is optional in Ox (unlike C++)


Line::Line(const orig)
{
    x = y = orig;               // set cursor at the origin
    origin = orig;           // only allowed in constructor
    cLines++;               // count number of Line objects
}
Line::moveto(const ax, const ay)
{
    x = ax;  y = ay;
    print("moved to ", ax, " ", ay, "\n");
    return this;
}
Line::lineto(const ax, const ay)
{
                 // draw the line from (x,y) to (ax,ay) ...
    x = ax;  y = ay;
    print("line to ", ax, " ", ay, "\n");
    return this;
}
Line::getcLines()
{
    return cLines;
}
Line::setcLines(c)
{
    cLines = c;
//  x = 0;                  // error: must be static member
//  lineto(1, 1);           // error: must be static member
}
   
