Game::Game(unsigned width, unsigned height, bool manual) : __width(width), __height(height) { if (width < MIN_WIDTH || height < MIN_HEIGHT) throw InsufficientDimensionsEx(MIN_WIDTH, MIN_HEIGHT, width, height); __status = NOT_STARTED; __verbose = false; __round = 0; for (unsigned pos = 0; pos < (__width * __height); ++pos) __grid.push_back(nullptr); if(!manual) populate(); }
// note: manual population by default Game::Game(unsigned width, unsigned height, bool manual) { if (width < MIN_WIDTH || height < MIN_HEIGHT) throw InsufficientDimensionsEx(MIN_WIDTH, MIN_HEIGHT, width, height); __width = width; __height = height; __status = NOT_STARTED; //__verbose = false; // __round = 0; for(int i = 0; i < __width * __height; i++) { __grid.push_back(nullptr); } if(!manual) populate(); }
Game::Game(unsigned int width, unsigned int height, bool manual): __width(width), __height(height) { if(height < Game::MIN_HEIGHT || width < Game::MIN_WIDTH) throw InsufficientDimensionsEx(Game::MIN_WIDTH, Game::MIN_HEIGHT, width, height); __status= NOT_STARTED; __verbose=false; __round=0; for(unsigned int i = 0; i < width*height; i++) __grid.push_back(NULL); if(!manual) populate(); }
Game::Game(unsigned width, unsigned height, bool manual) : __width(width), __height(height) { // note: manual population by default if (width < MIN_WIDTH || height < MIN_HEIGHT) { throw InsufficientDimensionsEx(MIN_WIDTH, MIN_HEIGHT, width, height); } __status = NOT_STARTED; __verbose = false; __round = 0; for (unsigned i = 0; i < (__width * __height); ++i) { __grid.push_back(nullptr); } if (!manual) { populate(); } }
Game::Game(unsigned width, unsigned height, bool manual /*= true*/){ if(width >= MIN_WIDTH && height >= MIN_HEIGHT){ __round = 0; __width = width; __height = height; __numInitAgents = 0; __numInitResources = 0; for(unsigned i=0; i < __width*__height; i++){ __grid.push_back(nullptr); } if(!manual){ populate(); } } else{ throw InsufficientDimensionsEx(MIN_WIDTH, MIN_HEIGHT, width, height); } }
Game::Game(unsigned width, unsigned height, bool manual) : __grid(width * height, nullptr) { if (width < MIN_WIDTH || height < MIN_HEIGHT) { throw InsufficientDimensionsEx(MIN_WIDTH, MIN_HEIGHT, width, height); } __width = width; __height = height; __round = 0; __status = NOT_STARTED; __verbose = false; if (!manual) { populate(); } }
Game::Game(unsigned width, unsigned height, bool manual) : __grid(width*height,nullptr), __round(0), __status(NOT_STARTED) { __width = width; __height = height; __numInitAgents = (__width * __height) /NUM_INIT_AGENT_FACTOR; __numInitResources = (__width * __height) /NUM_INIT_RESOURCE_FACTOR; __verbose = false; if (width < MIN_WIDTH || height < MIN_HEIGHT) throw InsufficientDimensionsEx(MIN_WIDTH, MIN_HEIGHT, width, height); if (! manual) void populate(); }
// note: manual population by default Game::Game(unsigned width, unsigned height, bool manual): __width(width), __height(height) { if (height < MIN_HEIGHT || width < MIN_WIDTH) { throw InsufficientDimensionsEx(MIN_WIDTH, MIN_HEIGHT, width, height); } __numInitAgents = 0; __numInitResources = 0; __width = width; __height = height; __verbose = false; __status = NOT_STARTED; __round = 0; for (int i = 0; i < __width*__height; i++) { __grid.push_back(nullptr) ; } if(!manual) { populate(); } }