コード例 #1
0
void BathroomPlanBuilder::buildWalls()
{
    Wall wall_front(0, 0, 4, 0);
    Wall wall_left(0, 0, 0, 2);
    Wall wall_rigth(4,0, 4,2);
    Wall wall_back(0,2,4,2);
    plan_->addWall(wall_front);
    plan_->addWall(wall_left);
    plan_->addWall(wall_rigth);
    plan_->addWall(wall_back);
}
コード例 #2
0
void BedroomPlanBuilder::buildWalls()
{
    Wall wall_front(0, 0, 5, 0);
    Wall wall_left(0, 0, 0, 5);
    Wall wall_rigth(5, 0, 5, 5);
    Wall wall_back(0, 5, 5, 5);
    plan_->addWall(wall_front);
    plan_->addWall(wall_left);
    plan_->addWall(wall_rigth);
    plan_->addWall(wall_back);
}
コード例 #3
0
ファイル: ai.cpp プロジェクト: maverickdgg/NamCap
//Done By Daniel(Leader)
//check the monster location and the direction they go 
void monster(COORD& monster1,int& g_idirection)
{
    bool bcollision = false;
	//check the condition met  
    if(bcollision == false)
	{
		if(g_idirection == 0)
		{
			//when the condition met
			if(wall_left(monster1) == true)
			{
				bcollision = true;
			}
			else
			{ 
				monster1.X--;
			}
            }
            if(g_idirection == 1)
            {
                if(wall_right(monster1) == true)
				{
                    bcollision=true;
                }
                else
				{
					monster1.X++;
                }
            }
            if(g_idirection==2)
            {
               if(wall_down(monster1) == true)
			   {
				   bcollision=true;
			   }
			   else
			   {
				   monster1.Y++;
			   }
            }
            if(g_idirection == 3)
            {
                if(wall_up(monster1) == true)
				{
                    bcollision=true;
                }
                else
				{
					monster1.Y--;
                }
            }
			//check what wall they hit 
            if(wall_up(monster1) == false && wall_down(monster1) == false && wall_left(monster1) == false && wall_right(monster1) == false)
			{
                bcollision=true;
            }
            if(wall_up(monster1) == false && wall_down(monster1) == false && wall_left(monster1) == false)
			{
                bcollision=true;
            }
            if(wall_up(monster1) == false && wall_down(monster1) == false && wall_right(monster1) == false)
			{
                bcollision=true;
            }
            if(wall_up(monster1) == false && wall_left(monster1) == false && wall_right(monster1) == false)
			{
                bcollision=true;
            }
            if(wall_down(monster1) == false && wall_left(monster1) == false && wall_right(monster1) == false)
			{
                bcollision=true;
            }
    }
	//if the monster is going against the wall re-roll the direction
    if(bcollision == true)
	{
        reroll(g_idirection);
    }
}