Code example for RectF

Methods: contains

0
	public void setUnitType(UnitType type) {
		this.currentUnitType = type;
	} 
 
	public int checkUnitChange(float x, float y) {
		if (!DIMENSIONS.contains(x, y))
			return -1; 
 
		if (y < UNIT_HEIGHT) {
			return 0; 
		} else { 
			return 1; 
		} 
	} 
 
	public void draw(Canvas canvas) {
		canvas.drawRect(DIMENSIONS, rectPaint);
 
		// TODO Fixme 
		if (this.currentUnitType == UnitType.ATTACKING) {
			unitPaint.setColor(Color.WHITE);