#pragma once

#define ANIM_KNIGHT_IDLE         0
#define ANIM_KNIGHT_RUN          1
#define ANIM_KNIGHT_ATTACK_SIDE1 2
#define ANIM_KNIGHT_ATTACK_SIDE2 3
#define ANIM_KNIGHT_ATTACK_TOP1  4
#define ANIM_KNIGHT_ATTACK_TOP2  5
#define ANIM_KNIGHT_ATTACK_BACK1 6
#define ANIM_KNIGHT_ATTACK_BACK2 7

const u16 cell_size = 192;
SpriteSheet knight = {
    .name = "blue_knight",
    .texture = {0},
    // .anim_count = 8,
    .size = { 1152, 1536 },
};

const Vector2 knight_origin = {cell_size / 2, cell_size / 2};
const Size knight_col_size = {75, 100};
// TODO: We probably want this as a helper function somewhere
const Rectangle knight_colrect_select = {
    knight_origin.x - knight_col_size.width / 2,
    knight_origin.y - knight_col_size.height / 2,
    knight_col_size.width,
    knight_col_size.height,
};

SpriteAnimation knight_idle = {
    .name = "idle",
    .total_frames = 6,
    .loop = true,
    .src_rect = { 0, cell_size * 0, cell_size, cell_size },
};

SpriteAnimation knight_run = {
    .name = "run",
    .total_frames = 6,
    .loop = true,
    .src_rect = { 0, cell_size * 1, cell_size, cell_size },
};

SpriteAnimation knight_attack_side1 = {
    .name = "attack_side1",
    .total_frames = 6,
    .loop = false,
    .src_rect = { 0, cell_size * 2, cell_size, cell_size },
};

SpriteAnimation knight_attack_side2 = {
    .name = "attack_side2",
    .total_frames = 6,
    .loop = false,
    .src_rect = { 0, cell_size * 3, cell_size, cell_size },
};

SpriteAnimation knight_attack_front1 = {
    .name = "attack_front1",
    .total_frames = 6,
    .loop = false,
    .src_rect = { 0, cell_size * 4, cell_size, cell_size },
};

SpriteAnimation knight_attack_front2 = {
    .name = "attack_front2",
    .total_frames = 6,
    .loop = false,
    .src_rect = { 0, cell_size * 5, cell_size, cell_size },
};

SpriteAnimation knight_attack_back1 = {
    .name = "attack_back1",
    .total_frames = 6,
    .loop = false,
    .src_rect = { 0, cell_size * 6, cell_size, cell_size },
};

SpriteAnimation knight_attack_back2 = {
    .name = "attack_back2",
    .total_frames = 6,
    .loop = false,
    .src_rect = { 0, cell_size * 7, cell_size, cell_size },
};

SpriteAnimation knight_anims[8];
// knight_anims[ANIM_KNIGHT_IDLE] = knight_idle;
// knight_anims[ANIM_KNIGHT_RUN] = knight_run;
// knight_anims[ANIM_KNIGHT_ATTACK_SIDE1] = knight_attack_side1;
// knight_anims[ANIM_KNIGHT_ATTACK_SIDE2] = knight_attack_side2;
// knight_anims[ANIM_KNIGHT_ATTACK_TOP1] = knight_attack_front1;
// knight_anims[ANIM_KNIGHT_ATTACK_TOP2] = knight_attack_front2;
// knight_anims[ANIM_KNIGHT_ATTACK_BACK1] = knight_attack_back1;
// knight_anims[ANIM_KNIGHT_ATTACK_BACK2] = knight_attack_back2;
