LifeCycle.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: Beerware
2 /**
3  * @file LifeCycle.h
4  * @brief Tamago life cycle handler
5  */
6 #pragma once
7 
8 #include <stdint.h>
9 
10 /**
11  * @enum Evolution
12  * @brief Tamago evolutions
13  */
14 typedef enum
15 {
16  EGG = 0, ///< Egg
17  BABYTCHI, ///< Baby, from Egg
18  MARUTCHI, ///< Child, from Babytchi
19  TAMATCHI, ///< Teen, good care from Marutchi
20  KUCHITAMATCHI, ///< Teen, bad care from Marutchi
21  MAMETCHI, ///< Adult, perfect care from Tamatchi
22  GINJIROTCHI, ///< Adult, above average care from Tamatchi
23  MASKUTCHI, ///< Adult, average care from Tamatchi
24  KUCHIPATCHI, ///< Adult, below average care from Tamatchi, perfect care from Kuchitamatchi
25  NYOROTCHI, ///< Adult, bad care from Tamatchi, average care from Kuchitamatchi
26  TARAKOTCHI, ///< Adult, Horrible care from both
27  OYAJITCHI, ///< Special, no discipline until it evolves to Maskutchi, perfect care from Maskutchi
28  OBAKETCHI ///< Dead
29 
30 } Evolution;
31 
32 /**
33  * @brief Status flags
34  */
35 typedef enum
36 {
37  HAS_POOPED = 0,
38  IS_SICK,
39  IS_SLEEPING,
40  IS_TIRED
41 
42 } StatusFlag;
43 
44 /**
45  * @struct Stats
46  * @brief Pet statistics
47  */
48 typedef struct
49 {
50  uint16_t u16Flags; ///< Status flags (bit-field)
51  uint16_t u16CareMistages; ///< Number of care mistakes
52  Evolution eEvolution; ///< Current evolution
53 
54 } Stats;
55 
56 void LifeCycle_Init(void);
60 void LifeCycle_SetFlag(StatusFlag eFlag);
@ BABYTCHI
Baby, from Egg.
Definition: LifeCycle.h:17
void LifeCycle_SetFlag(StatusFlag eFlag)
Set status flag.
Definition: LifeCycle.c:82
@ KUCHITAMATCHI
Teen, bad care from Marutchi.
Definition: LifeCycle.h:20
@ MARUTCHI
Child, from Babytchi.
Definition: LifeCycle.h:18
@ NYOROTCHI
Adult, bad care from Tamatchi, average care from Kuchitamatchi.
Definition: LifeCycle.h:25
void LifeCycle_ClearFlat(StatusFlag eFlag)
Clear status flag.
Definition: LifeCycle.c:72
@ TAMATCHI
Teen, good care from Marutchi.
Definition: LifeCycle.h:19
uint16_t u16Flags
Status flags (bit-field)
Definition: LifeCycle.h:50
StatusFlag
Status flags.
Definition: LifeCycle.h:35
@ OBAKETCHI
Dead.
Definition: LifeCycle.h:28
@ TARAKOTCHI
Adult, Horrible care from both.
Definition: LifeCycle.h:26
@ GINJIROTCHI
Adult, above average care from Tamatchi.
Definition: LifeCycle.h:22
@ EGG
Egg.
Definition: LifeCycle.h:16
Pet statistics.
Definition: LifeCycle.h:48
bool LifeCycle_IsFlagSet(StatusFlag eFlag)
Check if status flag is set.
Definition: LifeCycle.c:55
@ MASKUTCHI
Adult, average care from Tamatchi.
Definition: LifeCycle.h:23
@ MAMETCHI
Adult, perfect care from Tamatchi.
Definition: LifeCycle.h:21
Stats * LifeCycle_GetStats(void)
Get pet statistics.
Definition: LifeCycle.c:42
Evolution
Tamago evolutions.
Definition: LifeCycle.h:14
uint16_t u16CareMistages
Number of care mistakes.
Definition: LifeCycle.h:51
void LifeCycle_Init(void)
Initialise life cycle.
Definition: LifeCycle.c:33
@ KUCHIPATCHI
Adult, below average care from Tamatchi, perfect care from Kuchitamatchi.
Definition: LifeCycle.h:24
Evolution eEvolution
Current evolution.
Definition: LifeCycle.h:52
@ OYAJITCHI
Special, no discipline until it evolves to Maskutchi, perfect care from Maskutchi.
Definition: LifeCycle.h:27