/*
* Copyright (C) 2016 iZc
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package de.nplusc.izc.Utilities.WPCMgr;
/**
*
* @author iZc
*/
public class Screen
{
private final int x,y,w,h;
public Screen(int x,int y,int w,int h)
{
this.x=x;
this.y=y;
this.w=w;
this.h=h;
}
/**
*
* @param other
* @return [rx,ry,w,h]
*/
public int[] intersectArea(Screen other)
{
if((this.x+w<=other.x&&this.y+h<=other.y)
||(other.x+other.w<=w&&other.y+other.h<=h))
{
return new int[]{0,0,0,0};
}
if(this.x