-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcamagotchi.c
51 lines (47 loc) · 1.19 KB
/
camagotchi.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
///
/// FILENAME: camagotchi.c
/// DESCRIPTION: the implementation of the camagotchi
/// CONTRIBUTORS: Justin Sostre, Joe DeGrand
///
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include "camagotchi.h"
#include "modes.h"
void wants_attention(Game *game, pthread_mutex_t *mutex) {
}
void change_mode(Game *game, pthread_mutex_t *mutex) {
if ((game->cam)->alive == 0) {
return;
}
if (game->current_option == 1) {
lite(game, mutex);
} else if ((game->light == 0) && (game->stage != 0)) {
switch(game->current_option) {
case 0:
feed(game, mutex);
break;
case 1:
lite(game, mutex);
break;
case 2:
play(game, mutex);
break;
case 3:
meds(game, mutex);
break;
case 4:
duck(game, mutex);
break;
case 5:
hlth(game, mutex);
break;
case 6:
disc(game, mutex);
break;
case 7:
attn(game, mutex);
break;
}
}
}