public static MZGame getInstance() { if (instance == null) { instance = new MZGame(); } return(instance); }
/* * -(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); }
public static MZGame Start() { return(instance = new MZGame()); }