/*FTURTLE_____________________________________________________________________
Function Object turtle class
by Martin Robinson
____________________philosophy
immutability and recursivity is a key for a turtle
this object collection will only list movement
and return given color from coordinate as if it was a 2dimensional array
will also search for color and return coodinate
or simply list coordinate by order
undo is not only possible but easy

______________________________________________________________________________
PREPROCESSOR________________________________________________________________*/

#pragma once
#ifndef _FTURTLE
#define _FTURTLE

typedef unsigned int Color;
typedef signed int Axe;

/*____________________________________________________________________________
____________________________________________________________________________*/

//can be declared with coordinate or another turtle (turtle is coordinate)
//getter can take coordinate of another turtle, or both
//both mean , draw from turtleB result, then what is X,Y now
class fturtle{
    fturtle * _undo;
    Axe _x,                         //current pos
        _y;
    Color _color;                     //current color
public:
    fturtle();                      //default 0,0 black
    fturtle(Color);                   //0,0 color
    fturtle(Axe, Axe);              //x y black
    fturtle(Axe, Axe, Color);         //x y color
    fturtle(fturtle *);             //from another turtle

    virtual int at(Axe,Axe);
    virtual int at(fturtle*,Axe,Axe);   //if this turtle was starting point what is x,y now
    
    Axe x()const;
    Axe y()const;
    Color color()const;
    fturtle * undo()const;
};

class fwd : public fturtle{
public:
    fwd(fturtle*);
    fwd(fturtle*,int);
};

class cw : public fturtle{
public:
};

class ccw : public fturtle{
public:
};

class penUp : public fturtle{
public:
};

class penDown : public fturtle{
public:
};

class color : public fturtle{
public:
};

/*fill algo
no need to flood fill for every pixel we ask
and no need to append a fturtle for every pixel
tricky, maybe tracing a line to the filling center
if no intersect. then it is colored, but unstable
maybe djikstra or a*....

think about polygon system that manage its own fill
*/


#endif

