#pragma once

typedef struct Tile tile_t;

#include "util.h"
#include "game.h"

typedef enum {
  TILE_AIR,
  TILE_WOOD_PLATFORM,
  TILE_STONE_JOINT,
  TILE_STONE_WALL,
  TILE_GRASS,
  TILE_STONE,
  TILE_SNOW,
  TILE_SAND,
} tile_e;

struct Tile {
  pos_t pos;
  tile_e type;
};

tile_t *tile_create(pos_t pos, tile_e type);
void tile_update(tile_t *tile, game_t *game);
void tile_draw(tile_t *tile, game_t *game);
tile_t *tile_get(game_t *game, int x, int y);
bool tile_ground(tile_t *tile);
bool tile_solid(tile_t *tile);
bool tile_wall(tile_t *tile);
void tile_free(tile_t *tile);
