All pastes #338305 Raw Edit

Something

public text v1 · immutable
·published 2007-02-03 09:50 UTC
rendered paste body
bool Pawn :: Move(int X, int Y, bool Attack)
{
	bool test=false;
	Math math;

	if(!Attack && X==this->getX_position())
	{
		if(!this->getYaMove() && (math.abs(Y-this->getY_position()) <=2))
		{
			test=true;
		}
		else if(((Y-this->getY_position() )== 1) && (this->getColor())) 
		{
			test=true;
		}
		else if(((Y-this->getY_position() )== -1) && (!this->getColor()))
		{
			test=true;
		}
	}
	else if (Attack)
	{
		if( X == (this->getX_position()-1) || X == (this->getX_position()+1))
		{
			if( Y == (this->getY_position()+1) )
			{
				test=true;
			}
		}

	}

	return test;
}