/**
 * Copyright (c) 2021 Dominic Masters
 * 
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

#include "look.h"

void _pokerGameActionLookOnStart(
  queue_t *queue, queueaction_t *action, uint8_t i
) { 
  pokergame_t *game = (pokergame_t *)action->data;
  pokergameactiondata_t *data = game->actionData + i;
  pokerWorldLookAtPlayer(&game->scene, data->lookAtPlayer);
  queueNext(queue);
}

queueaction_t * pokerGameActionLookAdd(pokergame_t *game, uint8_t playerIndex) {
  queueaction_t *action = pokerGameActionAdd(game);
  action->onStart = &_pokerGameActionLookOnStart;
  game->actionData[action->index].lookAtPlayer = playerIndex;
  return action;
}