Upper bound for ordinals. Unlikely that any roundabout has more than 10
exits, but again, OSM has unlimited opportunities.
This commit is contained in:
parent
3ea1461839
commit
88890a1914
@ -43,7 +43,7 @@ struct TurnInstructionsClass {
|
|||||||
const static short StartAtEndOfStreet = 14;
|
const static short StartAtEndOfStreet = 14;
|
||||||
|
|
||||||
std::string TurnStrings[15];
|
std::string TurnStrings[15];
|
||||||
std::string Ordinals[11];
|
std::string Ordinals[12];
|
||||||
|
|
||||||
//This is a hack until c++0x is available enough to use initializer lists.
|
//This is a hack until c++0x is available enough to use initializer lists.
|
||||||
TurnInstructionsClass(){
|
TurnInstructionsClass(){
|
||||||
@ -73,7 +73,8 @@ struct TurnInstructionsClass {
|
|||||||
Ordinals[7] = "seventh";
|
Ordinals[7] = "seventh";
|
||||||
Ordinals[8] = "eighth";
|
Ordinals[8] = "eighth";
|
||||||
Ordinals[9] = "nineth";
|
Ordinals[9] = "nineth";
|
||||||
Ordinals[10] = "tenth";
|
Ordinals[10] = "tenth";
|
||||||
|
Ordinals[11] = "one of the too many";
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline double GetTurnDirectionOfInstruction( const double angle ) {
|
static inline double GetTurnDirectionOfInstruction( const double angle ) {
|
||||||
|
@ -114,7 +114,7 @@ public:
|
|||||||
if(TurnInstructions.LeaveRoundAbout == segment.turnInstruction) {
|
if(TurnInstructions.LeaveRoundAbout == segment.turnInstruction) {
|
||||||
reply.content += TurnInstructions.TurnStrings[TurnInstructions.EnterRoundAbout];
|
reply.content += TurnInstructions.TurnStrings[TurnInstructions.EnterRoundAbout];
|
||||||
reply.content += " and leave at ";
|
reply.content += " and leave at ";
|
||||||
reply.content += TurnInstructions.Ordinals[roundAbout.leaveAtExit+1];
|
reply.content += TurnInstructions.Ordinals[std::min(11,roundAbout.leaveAtExit+1)];
|
||||||
reply.content += " exit";
|
reply.content += " exit";
|
||||||
roundAbout.leaveAtExit = 0;
|
roundAbout.leaveAtExit = 0;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user