001: /*
002: 
003:   File: PuzzlePieces.cpp
004: 
005:   (c) 2003 by Oliver Ehli
006: 
007:      This program is free software; you can redistribute it and/or modify
008:      it under the terms of the GNU General Public License as published by
009:      the Free Software Foundation; either version 2 of the License, or
010:      (at your option) any later version.
011: 
012:      This program is distributed in the hope that it will be useful,
013:      but WITHOUT ANY WARRANTY; without even the implied warranty of
014:      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015:      GNU General Public License for more details.
016: 
017:      You should have received a copy of the GNU General Public License
018:      along with this program; if not, write to the Free Software
019:      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
020: 
021:      See File LICENSE for more Information.
022: 
023: */
024: #include "Puzzle.h"
025: 
026: /*
027:   Piece definitions:
028:   int array describing 'bounding-box',
029:   [x][y][z]
030: 
031:   bool array describing unit-cubes:
032:   [z][y][x]
033: 
034:   { z-areas
035:     { y-rows
036:       {
037:         x-flags 
038:        }
039:     }
040:    }
041: 
042: */
043: 
044: 
045: 
046: // Piece 1:
047: //
048: //  o o
049: //  ooo
050: 
051: 
052: int piece1_dim[] =
053:   {
054:     3, 2, 1
055:   };
056: 
057: bool piece1_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
058: {
059:   {
060:     { true,  true,  true  },
061:     { true,  false, true },
062:     { }
063:   },
064:   { }
065: };
066: 
067: 
068: // Piece 2:
069: //
070: //  o
071: //  ooo
072: //   o
073: 
074: 
075: int piece2_dim[] =
076:   {
077:     3, 3, 1
078:   };
079: 
080: bool piece2_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
081: {
082:   {
083:     { false, true,  false  },
084:     { true,  true,  true  },
085:     { true,  false, false  }
086:   }
087: };
088: 
089: 
090: 
091: 
092: // Piece 3:
093: //
094: //  o o
095: // oooo
096: 
097: 
098: int piece3_dim[] =
099:   {
100:     4, 2, 1
101:   };
102: 
103: bool piece3_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
104: {
105:   {
106:     { true,  true,  true,  true  },
107:     { false, true,  false, true  }
108:   }
109: };
110: 
111: 
112: 
113: 
114: // Piece 4:
115: //
116: //  o
117: //  o
118: // ooo
119: 
120: 
121: int piece4_dim[] =
122:   {
123:     3, 3, 1
124:   };
125: 
126: bool piece4_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
127: {
128:   {
129:     { true,  true, true  },
130:     { false, true, false },
131:     { false, true, false }
132:   }
133: };
134: 
135: 
136: 
137: // Piece 5:
138: //
139: //  oo
140: //  o
141: // oo
142: 
143: 
144: int piece5_dim[] =
145:   {
146:     3, 3, 1
147:   };
148: 
149: bool piece5_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
150: {
151:   {
152:     { true, true, false },
153:     { false, true, false },
154:     { false, true, true }
155:   }
156: };
157: 
158: 
159: 
160: 
161: // Piece 6:
162: //
163: // oo
164: // ooo
165: 
166: 
167: int piece6_dim[] =
168:   {
169:     3, 2, 1
170:   };
171: 
172: bool piece6_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
173: {
174:   {
175:     { true, true, true  },
176:     { true, true, false  }
177:   }
178: };
179: 
180: 
181: 
182: 
183: // Piece 7:
184: //
185: // o    o
186: // oo   o
187: // z=0, z=1
188: 
189: int piece7_dim[] =
190:   {
191:     2, 2, 2
192:   };
193: 
194: bool piece7_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
195: {
196:   {
197:     { true, true  },
198:     { true, false }
199:   },
200:   {
201:     { true, false },
202:     { true, false }
203:   }
204: };
205: 
206: 
207: 
208: 
209: // Piece 8:
210: //
211: //  o
212: // ooo
213: //  o
214: 
215: 
216: int piece8_dim[] =
217:   {
218:     3, 3, 1
219:   };
220: 
221: bool piece8_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
222: {
223:   {
224:     { false, true, false },
225:     { true,  true, true  },
226:     { false, true, false }
227:   }
228: };
229: 
230: 
231: 
232: // Piece 9:
233: //
234: //       o
235: // oo    o
236: // z=0, z=1
237: 
238: 
239: int piece9_dim[] =
240:   {
241:     2, 2, 2
242:   };
243: 
244: bool piece9_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
245: {
246:   {
247:     { true, true   },
248:     { false, false }
249:   },
250:   {
251:     { false, true  },
252:     { false, true  }
253:   }
254: };
255: 
256: 
257: 
258: 
259: // Piece 10:
260: //
261: //  o
262: //  oooo
263: 
264: 
265: int piece10_dim[] =
266:   {
267:     4, 2, 1
268:   };
269: 
270: bool piece10_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
271: {
272:   {
273:     { true, true,  true,  true  },
274:     { true, false, false, false }
275:   }
276: };
277: 
278: 
279: 
280: 
281: // Piece 11:
282: //
283: // o
284: // oo
285: //  oo
286: 
287: 
288: int piece11_dim[] =
289:   {
290:     3, 3, 1
291:   };
292: 
293: bool piece11_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
294: {
295:   {
296:     { false, true,  true  },
297:     { true,  true,  false },
298:     { true,  false, false }
299:   }
300: };
301: 
302: 
303: 
304: 
305: // Piece 12:
306: //
307: //
308: //  o
309: // oooo
310: 
311: 
312: int piece12_dim[] =
313:   {
314:     4, 2, 1
315:   };
316: 
317: bool piece12_desc[PC_Z_DIM][PC_Y_DIM][PC_X_DIM]  =
318: {
319:   {
320:     { true,  true, true,  true  },
321:     { false, true, false, false }
322:   }
323: };
324: 
325: 
326: