#ifndef ANIMATOR_H
#define ANIMATOR_H

#import <raylib.h>
#import <yeslib.h>
#import <yesmath.h>
#import "DialogueBox.h"

typedef struct Node2D Node2D;

struct Node2D {
    Node2D *prev;
    Node2D *next;
    Vector2 start; //unused
    Vector2 end;
};

/*
typedef struct Target3D {
    Vector3 start;
    Vector3 end;
} Target3D;
*/

/*
typedef union Node {
    Target2D t2d;
    Target3D t3d;
} Node;
*/

/*
    i could pass in pointers to vectors and animate those
    or pass a pointer to an object
*/

//array of nodes to move the subject along
@interface Animator : YSArray {
    int speed; //more = slower
    int left; //ticks left before do thing
    float increment;
    id subject;
    Vector2 nodes[50]; //hardcode 50 for now
    int nodecnt;
}

+(id) new;
-(id) init;
-(void) tick;
-(void) setSpeed: (int) s;
-(void) setTicks: (int) t;
-(void) setIncrement: (float) i;
-(void) setSubject: (id) sub;
-(void) addNode: (Vector2) node;
-(void) draw;


@end

#endif