Пример #1
0
 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
 public static MZGame Start()
 {
     return(instance = new MZGame());
 }