struct game_state

Defined at line 40 of file ../../sdk/lib/fit-promise/tests/examples/promise_example2.cc

State for a two player game.

Players do battle by simultaneously rolling dice in order to inflict

damage upon their opponent over the course of several rounds until one

or both players' hit points are depleted to 0.

Players start with 100 hit points. During each round, each player first

rolls a Damage die (numbered 0 to 9) and an Effect die (numbered 0 to 3).

If the Effect die comes up 0, the player casts a lightning spell and

rolls an Effect Multiplier die (numbered 0 to 4) to determine the

strength of the effect.

The following calculation determines the damage dealt to the player's

opponent:

if Damage die value is non-zero,

then opponent HP -= value of Damage die

if Effect die is zero (cast lighting),

then opponent HP -= value of Effect Multiplier die * 2 + 3

Any dice that fly off the table during especially vigorous rolls are

rerolled before damage is tallied.

Public Members

int red_hp
int blue_hp