示例#1
0
    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();
    }
示例#2
0
// 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();

    }
示例#3
0
    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();
    }
示例#4
0
    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();
        }
    }
示例#5
0
 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);
     }
 }
示例#6
0
    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();
        }
    }
示例#7
0
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();
        
    }
示例#8
0
    // 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();
        }
    }