summaryrefslogtreecommitdiff
path: root/src/simulation/SimulationData.cpp
blob: 15a7b1a2f0f6b779714b2ff5d344b483ead6acd1 (plain)
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
 * SimulationData.cpp
 *
 *  Created on: Jan 24, 2012
 *      Author: Simon
 */
#include "SimulationData.h"
//#include "ElementFunctions.h"
#include "ElementGraphics.h"
#include "Elements.h"

gol_menu * LoadGOLMenu(int & golMenuCount)
{
	gol_menu golMenu[NGOL] =
	{
		{"GOL",		PIXPACK(0x0CAC00), 0, "Game Of Life B3/S23"},
		{"HLIF",	PIXPACK(0xFF0000), 1, "High Life B36/S23"},
		{"ASIM",	PIXPACK(0x0000FF), 2, "Assimilation B345/S4567"},
		{"2x2",		PIXPACK(0xFFFF00), 3, "2x2 B36/S125"},
		{"DANI",	PIXPACK(0x00FFFF), 4, "Day and Night B3678/S34678"},
		{"AMOE",	PIXPACK(0xFF00FF), 5, "Amoeba B357/S1358"},
		{"MOVE",	PIXPACK(0xFFFFFF), 6, "'Move' particles. Does not move things.. it is a life type B368/S245"},
		{"PGOL",	PIXPACK(0xE05010), 7, "Pseudo Life B357/S238"},
		{"DMOE",	PIXPACK(0x500000), 8, "Diamoeba B35678/S5678"},
		{"34",		PIXPACK(0x500050), 9, "34 B34/S34"},
		{"LLIF",	PIXPACK(0x505050), 10, "Long Life B345/S5"},
		{"STAN",	PIXPACK(0x5000FF), 11, "Stains B3678/S235678"},
		{"SEED",	PIXPACK(0xFBEC7D), 12, "B2/S"},
		{"MAZE",	PIXPACK(0xA8E4A0), 13, "B3/S12345"},
		{"COAG",	PIXPACK(0x9ACD32), 14, "B378/S235678"},
		{"WALL",	PIXPACK(0x0047AB), 15, "B45678/S2345"},
		{"GNAR",	PIXPACK(0xE5B73B), 16, "B1/S1"},
		{"REPL",	PIXPACK(0x259588), 17, "B1357/S1357"},
		{"MYST",	PIXPACK(0x0C3C00), 18, "B3458/S05678"},
		{"LOTE",	PIXPACK(0xFF0000), 19, "Behaves kinda like Living on the Edge S3458/B37/4"},
		{"FRG2",	PIXPACK(0x00FF00), 20, "Like Frogs rule S124/B3/3"},
		{"STAR",	PIXPACK(0x0000FF), 21, "Like Star Wars rule S3456/B278/6"},
		{"FROG",	PIXPACK(0x00AA00), 22, "Frogs S12/B34/3"},
		{"BRAN",	PIXPACK(0xCCCC00), 23, "Brian 6 S6/B246/3"}
	};
	golMenuCount = NGOL;
	gol_menu * golMenuT = (gol_menu*)malloc(NGOL*sizeof(gol_menu));
	memcpy(golMenuT, golMenu, NGOL*sizeof(gol_menu));
	return golMenuT;
}

int * LoadGOLRules(int & golRuleCount)
{
	int golRules[NGOL+1][10] =
	{
	//	 0,1,2,3,4,5,6,7,8,STATES    live=1  spawn=2 spawn&live=3   States are kind of how long until it dies, normal ones use two states(living,dead) for others the intermediate states live but do nothing
		{0,0,0,0,0,0,0,0,0,2},//blank
		{0,0,1,3,0,0,0,0,0,2},//GOL
		{0,0,1,3,0,0,2,0,0,2},//HLIF
		{0,0,0,2,3,3,1,1,0,2},//ASIM
		{0,1,1,2,0,1,2,0,0,2},//2x2
		{0,0,0,3,1,0,3,3,3,2},//DANI
		{0,1,0,3,0,3,0,2,1,2},//AMOE
		{0,0,1,2,1,1,2,0,2,2},//MOVE
		{0,0,1,3,0,2,0,2,1,2},//PGOL
		{0,0,0,2,0,3,3,3,3,2},//DMOE
		{0,0,0,3,3,0,0,0,0,2},//34
		{0,0,0,2,2,3,0,0,0,2},//LLIF
		{0,0,1,3,0,1,3,3,3,2},//STAN
		{0,0,2,0,0,0,0,0,0,2},//SEED
		{0,1,1,3,1,1,0,0,0,2},//MAZE
		{0,0,1,3,0,1,1,3,3,2},//COAG
		{0,0,1,1,3,3,2,2,2,2},//WALL
		{0,3,0,0,0,0,0,0,0,2},//GNAR
		{0,3,0,3,0,3,0,3,0,2},//REPL
		{1,0,0,2,2,3,1,1,3,2},//MYST
		{0,0,0,3,1,1,0,2,1,4},//LOTE
		{0,1,1,2,1,0,0,0,0,3},//FRG2
		{0,0,2,1,1,1,1,2,2,6},//STAR
		{0,1,1,2,2,0,0,0,0,3},//FROG
		{0,0,2,0,2,0,3,0,0,3},//BRAN
	};
	golRuleCount = NGOL+1;
	int * golRulesT = (int*)malloc((golRuleCount*10)*sizeof(int));
	memcpy(golRulesT, golRules, (golRuleCount*10)*sizeof(int));
	return golRulesT;
}

int * LoadGOLTypes(int & golTypeCount)
{
	int golTypes[NGOL] =
	{
		GT_GOL,
		GT_HLIF,
		GT_ASIM,
		GT_2x2,
		GT_DANI,
		GT_AMOE,
		GT_MOVE,
		GT_PGOL,
		GT_DMOE,
		GT_34,
		GT_LLIF,
		GT_STAN,
		GT_SEED,
		GT_MAZE,
		GT_COAG,
		GT_WALL,
		GT_GNAR,
		GT_REPL,
		GT_MYST,
		GT_LOTE,
		GT_FRG2,
		GT_STAR,
		GT_FROG,
		GT_BRAN,
	};
	golTypeCount = NGOL;
	int * golTypesT = (int*)malloc((golTypeCount)*sizeof(int));
	memcpy(golTypesT, golTypes, (golTypeCount)*sizeof(int));
	return golTypesT;
}

wall_type * LoadWalls(int & wallCount)
{
	wall_type wtypes[] =
	{
		{PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "Erases walls."},
		{PIXPACK(0xC0C0C0), PIXPACK(0x101010), 0, Renderer::WallIcon, "Wall. Indestructible. Blocks everything. Conductive."},
		{PIXPACK(0x808080), PIXPACK(0x808080), 0, Renderer::WallIcon, "E-Wall. Becomes transparent when electricity is connected."},
		{PIXPACK(0xFF8080), PIXPACK(0xFF2008), 1, Renderer::WallIcon, "Detector. Generates electricity when a particle is inside."},
		{PIXPACK(0x808080), PIXPACK(0x000000), 0, Renderer::WallIcon, "Streamline. Set start point of a streamline."},
		{PIXPACK(0x8080FF), PIXPACK(0x000000), 1, Renderer::WallIcon, "Fan. Accelerates air. Use line tool to set direction and strength."},
		{PIXPACK(0xC0C0C0), PIXPACK(0x101010), 2, Renderer::WallIcon, "Wall. Blocks most particles but lets liquids through. Conductive."},
		{PIXPACK(0x808080), PIXPACK(0x000000), 1, Renderer::WallIcon, "Wall. Absorbs particles but lets air currents through."},
		{PIXPACK(0x808080), PIXPACK(0x000000), 3, Renderer::WallIcon, "Wall. Indestructible. Blocks everything."},
		{PIXPACK(0x3C3C3C), PIXPACK(0x000000), 1, Renderer::WallIcon, "Wall. Indestructible. Blocks particles, allows air"},
		{PIXPACK(0x575757), PIXPACK(0x000000), 1, Renderer::WallIcon, "Wall. Indestructible. Blocks liquids and gasses, allows powders"},
		{PIXPACK(0xFFFF22), PIXPACK(0x101010), 2, Renderer::WallIcon, "Conductor, allows particles, conducts electricity"},
		{PIXPACK(0x242424), PIXPACK(0x101010), 0, Renderer::WallIcon, "E-Hole, absorbs particles, release them when powered"},
		{PIXPACK(0x579777), PIXPACK(0x000000), 1, Renderer::WallIcon, "Wall. Indestructible. Blocks liquids and solids, allows gasses"},
		{PIXPACK(0xFFEE00), PIXPACK(0xAA9900), 4, Renderer::WallIcon, "Gravity wall"},
		{PIXPACK(0xFFAA00), PIXPACK(0xAA5500), 4, Renderer::WallIcon, "Energy wall, allows only energy type particles to pass"},
	};
	wallCount = UI_WALLCOUNT;
	wall_type * wtypesT = (wall_type*)malloc(UI_WALLCOUNT*sizeof(wall_type));
	memcpy(wtypesT, wtypes, UI_WALLCOUNT*sizeof(wall_type));
	return wtypesT;
}

menu_section * LoadMenus(int & menuCount)
{
	menu_section msections[] = //doshow does not do anything currently.
	{
		{"\xC1", "Walls", 0, 1},
		{"\xC2", "Electronics", 0, 1},
		{"\xD6", "Powered Materials", 0, 1},
		{"\xE2",  "Force", 0, 1},
		{"\xC3", "Explosives", 0, 1},
		{"\xC5", "Gasses", 0, 1},
		{"\xC4", "Liquids", 0, 1},
		{"\xD0", "Powders", 0, 1},
		{"\xD1", "Solids", 0, 1},
		{"\xC6", "Radioactive", 0, 1},
		{"\xCC", "Special", 0, 1},
		{"\xD2", "Life", 0, 1},
		{"\xD7", "Tools", 0, 1},
		{"\xE4", "Decoration tools", 0, 1},
		{"\xC8", "", 0, 0},
		{"\xC8", "Cracker", 0, 0},
		{"\xC8", "Cracker!", 0, 0},
	};
	menuCount = SC_TOTAL;
	menu_section * msectionsT = (menu_section*)malloc(SC_TOTAL*sizeof(menu_section));
	memcpy(msectionsT, msections, SC_TOTAL*sizeof(menu_section));
	return msectionsT;
}