comparison mde/input/input.d @ 7:b544c3a7c9ca

Some changes to exceptions and a few more debug commands. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Wed, 16 Jan 2008 12:48:07 +0000
parents 9a990644948c
children f63f4f41a2dc
comparison
equal deleted inserted replaced
6:dcb24afa0dce 7:b544c3a7c9ca
203 ret._q = q; 203 ret._q = q;
204 return ret; 204 return ret;
205 } 205 }
206 uint next () { // Get the next element. Throws an exception if there isn't another. 206 uint next () { // Get the next element. Throws an exception if there isn't another.
207 if (p >= _q.length) 207 if (p >= _q.length)
208 throw new InputException ("Input: Invalid configuration: incomplete config stack"); 208 throw new InputClassException ("Input: Invalid configuration: incomplete config stack");
209 uint ret = _q[p]; 209 uint ret = _q[p];
210 ++p; 210 ++p;
211 return ret; 211 return ret;
212 } 212 }
213 } 213 }
236 // They are used to start and continue an event stream. 236 // They are used to start and continue an event stream.
237 void bEventOut (bool b, readOutQueue s) 237 void bEventOut (bool b, readOutQueue s)
238 { 238 {
239 ES_B_Func* func = (s.next() in es_b_fcts); 239 ES_B_Func* func = (s.next() in es_b_fcts);
240 if (func != null) (*func)(b,s); 240 if (func != null) (*func)(b,s);
241 else throw new InputException ("Input: Invalid configuration: bad event function code"); 241 else throw new InputClassException ("Input: Invalid configuration: bad event function code");
242 } 242 }
243 void aEventOut (short x, readOutQueue s) 243 void aEventOut (short x, readOutQueue s)
244 { 244 {
245 ES_A_Func* func = (s.next() in es_a_fcts); 245 ES_A_Func* func = (s.next() in es_a_fcts);
246 if (func != null) (*func)(x,s); 246 if (func != null) (*func)(x,s);
247 else throw new InputException ("Input: Invalid configuration: bad event function code"); 247 else throw new InputClassException ("Input: Invalid configuration: bad event function code");
248 } 248 }
249 void mEventOut (short x, short y, readOutQueue s) 249 void mEventOut (short x, short y, readOutQueue s)
250 { 250 {
251 ES_M_Func* func = (s.next() in es_m_fcts); 251 ES_M_Func* func = (s.next() in es_m_fcts);
252 if (func != null) (*func)(x,y,s); 252 if (func != null) (*func)(x,y,s);
253 else throw new InputException ("Input: Invalid configuration: bad event function code"); 253 else throw new InputClassException ("Input: Invalid configuration: bad event function code");
254 } 254 }
255 255
256 // The remaining functions are the stream functions, for adjusting and outputting an event. 256 // The remaining functions are the stream functions, for adjusting and outputting an event.
257 257
258 // Simple output function 258 // Simple output function