forked from yoelsusanto/Engi-s-Kitchen-Extended
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
111 lines (108 loc) · 1.95 KB
/
main.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#include "data.h"
#include "ADT/array.h"
#include "ADT/boolean.h"
#include "ADT/jam.h"
#include "ADT/listrekursif.h"
#include "ADT/matriks.h"
#include "ADT/mesinkar.h"
#include "ADT/mesinkata.h"
#include "ADT/pohon.h"
#include "ADT/point.h"
#include "ADT/stackt.h"
#include "general.h"
#include "display.h"
/* Deklarasi variable global */
int main()
{
initMainMenu();
InitGame();
system("clear");
initLayout();
BacaCommand();
while (!(EqualKata(Command,"EXIT")) && GameData.Life > 0)
{
system("clear");
/* Game Main Loop */
if (EqualKata(Command, "RECIPE"))
{
CursePrintTree(Resep);
}
else if (EqualKata(Command, "GU"))
{
GU();
UpdateGameState(&GameData.Life);
}
else if (EqualKata(Command, "GD"))
{
GD();
UpdateGameState();
}
else if (EqualKata(Command, "GL"))
{
GL();
UpdateGameState();
}
else if (EqualKata(Command, "GR"))
{
GR();
UpdateGameState();
}
else if (EqualKata(Command, "ORDER"))
{
orderFood();
UpdateGameState();
}
else if (EqualKata(Command, "PUT"))
{
Put();
UpdateGameState();
}
else if (EqualKata(Command, "TAKE"))
{
Take();
UpdateGameState();
}
else if (EqualKata(Command, "CH"))
{
CreateEmptyStck(&Hand);
UpdateGameState();
}
else if (EqualKata(Command, "CT"))
{
CreateEmptyStck(&Tray);
UpdateGameState();
}
else if (EqualKata(Command, "PLACE"))
{
placeCustomer();
UpdateGameState();
}
else if (EqualKata(Command, "GIVE"))
{
giveFood();
UpdateGameState();
}
else if (EqualKata(Command, "RECIPE"))
{
orderFood();
}
else if (EqualKata(Command, "SAVE"))
{
orderFood();
}
else if (EqualKata(Command, "LOAD"))
{
orderFood();
}
else if (EqualKata(Command, "EXIT"))
{
printf("Goodbye!\n");
}
if (GameData.Life > 0)
{
updateLayout();
BacaCommand();
}
}
initCredit();
}