#import "InputHandler.h"

@implementation InputHandler

-(id) init {
    self = [super init];
    return self;
}

-(void) handleInput {
    static unsigned int set;

    if (set == 0) {
        set = IsKeyDown(KEY_W);
    }
 
    if ( set - IsKeyDown(KEY_W) ) {
        [controllable moveForward];
    } else if ( set - IsKeyDown(KEY_S) ) {
        [controllable moveBack];
    } else if ( set - IsKeyDown(KEY_A) ) {
        [controllable moveLeft];
    } else if ( set - IsKeyDown(KEY_D) ) {
        [controllable moveRight];
    } else if ( set - IsKeyDown(KEY_E) ) {
        [controllable activate];
    }


    if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
        [controllable attack];
    }
}

@end