public FOWPoint(int px, int py, TravelDirection t, int ptAmount)
 {
     X = px;
     Y = py;
     PreviousDirection = t;
     bool isDiag = false;
     switch(PreviousDirection) {
         case TravelDirection.PX:
             X++;
             break;
         case TravelDirection.NX:
             X--;
             break;
         case TravelDirection.PY:
             Y++;
             break;
         case TravelDirection.NY:
             Y--;
             break;
         case TravelDirection.PXPY:
             X++; Y++;
             isDiag = true;
             break;
         case TravelDirection.PXNY:
             X++; Y--;
             isDiag = true;
             break;
         case TravelDirection.NXPY:
             X--; Y++;
             isDiag = true;
             break;
         case TravelDirection.NXNY:
             X--; Y--;
             isDiag = true;
             break;
     }
     TravelAmount = ptAmount - (isDiag ? 14 : 10);
 }
Exemple #2
0
 public SatNavModel()
 {
     CurrentDirection = TravelDirection.North;
     CurrentSpeed = 0;
 }