#include <stdio.h>

#include "points.h"

int hand_points(Hand *hand) {
  int points = 0;
  for (int i = 0; i < hand->count; i++) {
    Card *c = hand->cards[i];
    switch (c->type) {
    case CHAFF:
      points += 1;
      break;
    case RIBBON:
      points += 5;
      break;
    case ANIMAL:
      points += 10;
      break;
    case BRIGHT:
      points += 20;
      break;
    }
  }

  return points - 88;
}

void kan_points_string(Game *g, int points, char *string) {
  sprintf(string, "%d kan %d", points / g->kan_value, points % g->kan_value);
}
