Added JS engine.

This commit is contained in:
2021-09-18 00:39:00 -07:00
parent 9dd9ce7cbd
commit ef9137fabb
52 changed files with 547 additions and 35712 deletions

View File

@ -11,6 +11,8 @@ void _pokerActionBlindsOnStart(queue_t *queue,queueaction_t *action,uint8_t i) {
poker_t *poker;
poker = (poker_t *)action->data;
poker->state = POKER_STATE_TAKING_BLINDS;
pokerBetTakeBlinds(poker);
printf("Taken Blinds\n");
queueNext(queue);

View File

@ -11,6 +11,8 @@ void _pokerActionDealOnStart(queue_t *queue, queueaction_t *action, uint8_t i) {
poker_t *poker;
poker = (poker_t *)action->data;
poker->state = POKER_STATE_DEALING;
// Shuffle the deck
cardShuffle(poker->dealer.deck, CARD_DECK_SIZE);

View File

@ -11,6 +11,8 @@ void _pokerActionFlopDo(queue_t *queue, queueaction_t *action, uint8_t count) {
poker_t *poker;
poker = (poker_t *)action->data;
poker->state = POKER_STATE_CARDS_FLOPPING;
pokerDealerBurn(&poker->dealer, 1);
pokerDealerTurn(&poker->dealer, count);

View File

@ -13,6 +13,8 @@ void _pokerActionMatchOnStart(queue_t *queue, queueaction_t *action, uint8_t i){
poker = (poker_t *)action->data;
poker->state = POKER_STATE_STARTING_MATCH;
// Reset the main game state. This does not init the round.
pokerBetInit(&poker->bet);
poker->roundDealer = POKER_PLAYER_COUNT-2;

View File

@ -15,6 +15,8 @@ void _pokerActionRoundOnStart(queue_t *queue, queueaction_t *action ,uint8_t i){
poker = (poker_t *)action->data;
poker->state = POKER_STATE_STARTING_ROUND;
// Prepare the initial game state
pokerBetReset(&poker->bet);
pokerDealerInit(&poker->dealer);