Work Life (Visual Novel / Game)
Loading...
Searching...
No Matches
minigame_state.h
1#pragma once
2#include "util.h"
4namespace minigame_state {
7 CODE = 0,
8 PAPERWORK = 1,
9 CALLS = 2,
10 BUGS = 3
11 };
13 constexpr unsigned int minigame_count = 4;
15 const minigame_game games[] = {CODE, PAPERWORK, CALLS, BUGS};
16
20 int successes[minigame_count];
22 int totals[minigame_count];
26 void init() {
27 for(auto game : games) {
28 successes[game] = 0;
29 totals[game] = 0;
30 }
31 weekly_successes = 0;
32 }
35 successes[game] += 1;
36 totals[game] += 1;
37 weekly_successes += 1;
38 }
41 successes[game] = util::max(successes[game] - 1, 0);
42 }
44 void weekly_reset() {
45 weekly_successes = 0;
46 }
47 };
48}
various minigame state structs
Definition minigame_state.h:4
constexpr unsigned int minigame_count
max number of minigame_type
Definition minigame_state.h:13
minigame_game
enum for each minigame
Definition minigame_state.h:6
const minigame_game games[]
convenience array of minigames
Definition minigame_state.h:15
void on_success(minigame_game game)
called when a minigame is completed successfully
Definition minigame_state.h:34
void init()
initialize the struct
Definition minigame_state.h:26
int weekly_successes
minigame total successes that is reset every week. used to display expectation during the week
Definition minigame_state.h:24
void weekly_reset()
called when the week changes
Definition minigame_state.h:44
void on_failure(minigame_game game)
called when a minigame is failed
Definition minigame_state.h:40