LPRect.java
上传用户:gyyuli
上传日期:2013-07-09
资源大小:3050k
文件大小:1k
源码类别:

J2ME

开发平台:

Java

  1. /**
  2.  * <p>Title: lipeng</p>
  3.  * <p>Description:
  4.  * You cannot remove this copyright and notice.
  5.  * You cannot use this file without the express permission of the author.
  6.  * All Rights Reserved</p>
  7.  * <p>Copyright: lizhenpeng (c) 2004</p>
  8.  * <p>Company: LP&P</p>
  9.  * @author lizhenpeng
  10.  * @version 1.0.0
  11.  * <p>
  12.  * Revise History
  13.  * </p>
  14.  */
  15. package lipeng;
  16. public class LPRect
  17. {
  18.   public int x;
  19.   public int y;
  20.   public int dx;
  21.   public int dy;
  22.   public static boolean IntersectRect(LPRect rect1, LPRect rect2)
  23.   {
  24.     if ( (rect1.x + rect1.dx > rect2.x) && (rect1.y + rect1.dy > rect2.y)
  25.         &&
  26.         (rect2.x + rect2.dy > rect1.x) && (rect2.y + rect2.dy > rect1.y))
  27.    {
  28.      return true;
  29.    }
  30.    return false;
  31.   }
  32. }