Exemple #1
0
 public IRail CheckForSwitch(char posSwitch, char posAbove, char posBelow)
 {
     _currSwitch++;
     if (posSwitch.Equals((char)Symbols.SwitchDown) || posSwitch.Equals((char)Symbols.SwitchUp))
     {
         if (posAbove.Equals((char)Symbols.CornerRailB) && posBelow.Equals((char)Symbols.CornerRailA))
         {
             SwitchConversion c = new SwitchConversion(Symbols.SwitchDown);
             _mainModel.AddSwitch(_currSwitch, c);
             return(c);
         }
         else if (posAbove.Equals((char)Symbols.CornerRailA) && posBelow.Equals((char)Symbols.CornerRailB))
         {
             SwitchDiversion c = new SwitchDiversion(Symbols.SwitchDown);
             _mainModel.AddSwitch(_currSwitch, c);
             return(c);
         }
     }
     return(null);
 }