Revision 1885
Changed index of INTERSECTION variables and got rid of getCrossPos and
getCrossType that are being implemented in the database.
validTurns.c | ||
---|---|---|
38 | 38 |
{ |
39 | 39 |
return randomNumGen(4); |
40 | 40 |
} |
41 |
*/ |
|
42 | 41 |
|
43 | 42 |
int getCrossType(int barcode){ |
44 | 43 |
int crosstype = (barcode>>2)&7; |
45 | 44 |
return crosstype; |
46 | 45 |
} |
47 |
int getCrossPos(int barcode, int max){ |
|
48 |
//@TODO: implement some max checking |
|
46 |
int getCrossPos(int barcode){ |
|
49 | 47 |
return (barcode)&3; |
50 | 48 |
} |
51 | 49 |
|
50 |
*/ |
|
51 |
|
|
52 | 52 |
int validateTurn(int barcode, int turn_type) |
53 | 53 |
{ |
54 | 54 |
int cross_type; |
... | ... | |
63 | 63 |
return turn_type; |
64 | 64 |
break; |
65 | 65 |
} |
66 |
case DOUBLE: //Implements DOUBLE as DOUBLE_T |
|
67 |
//@TODO: we really shouldn't use DOUBLE, it's part of another system. but it equals 0, so error checking. |
|
68 | 66 |
case INTERSECTION_DOUBLE_T: |
69 | 67 |
{ |
70 | 68 |
cross_pos = getCrossPos(barcode, 3); |
Also available in: Unified diff