예제 #1
0
파일: MZGame.cs 프로젝트: GA239/robolabwp
 public static MZGame getInstance()
 {
     if (instance == null)
     {
         instance = new MZGame();
     }
     return(instance);
 }
예제 #2
0
 /*
  * -(double)visibilityAtX:(int) x Y: (int) y
  * {
  *  if(x >= 0 && y >=0 && x < _width && y < _height)
  *  {
  *      int lastVisit = [_visits[x][y] integerValue];
  *      return MAX((1.0 - (double)([[MZGame getInstance] stepsCount] - lastVisit)/(double)LAST_STEPS_VISIBLE),0.0);
  *  }
  *  NSLog(@"Cell out of range");
  *  return -LAST_STEPS_VISIBLE;
  * }*/
 public double visibilityAtXY(int x, int y)
 {
     if (x >= 0 && y >= 0 && x < _width && y < _height)
     {
         int lastVisit = _visits[x][y];
         //MZGame game = MZGame.getInstance();
         //return max((1.0 - (double)(game.stepsCount() - lastVisit)/(double)MZMacro.LAST_STEPS_VISIBLE),0.0);
         return(max((1.0 - (double)(MZGame.getInstance().stepsCount() - lastVisit) / (double)MZMacro.LAST_STEPS_VISIBLE), 0.0));
     }
     return(-MZMacro.LAST_STEPS_VISIBLE);
 }
예제 #3
0
파일: MZGame.cs 프로젝트: GA239/robolabwp
 public static MZGame Start()
 {
     return(instance = new MZGame());
 }