DetermineDigArea.java
上传用户:penghbff
上传日期:2007-04-16
资源大小:32k
文件大小:2k
源码类别:

射击游戏

开发平台:

Java

  1. import java.awt.Point;
  2. import java.util.Vector;
  3. public class DetermineDigArea
  4. {
  5.  
  6.   DetermineMineMarkIsRightOrWrong 确定雷标记是否正确者=null;
  7.   public DetermineDigArea()
  8.   {
  9.     确定雷标记是否正确者=new DetermineMineMarkIsRightOrWrong();
  10.   }
  11.   public Vector 确定成片挖开区域(int i,int j,Block block[][],int 行数, int 列数)
  12.   { 
  13.          
  14.          Vector  area=new Vector();
  15.          area.add(new Point(i,j));
  16.          for(int index=0;index<area.size();index++) 
  17.            {
  18.               Point p=(Point)area.get(index);
  19.               int m=p.x,n=p.y;
  20.               for(int k=Math.max(m-1,1);k<=Math.min(m+1,行数);k++)
  21.                { for(int t=Math.max(n-1,1);t<=Math.min(n+1,列数);t++)
  22.                  { 
  23.                    boolean correct=确定雷标记是否正确者.判断雷标记是否正确(k,t,block,行数,列数);
  24.                    if(block[k][t].周围无雷==true&&block[k][t].isOpaque()&&!block[k][t].判断是否是雷()
  25.                       &&block[k][t].获取探雷标记()!=0)
  26.                      {
  27.                        Point addPoint=new Point(k,t);
  28.                        if(!(area.contains(addPoint)))
  29.                          {
  30.                            area.add(addPoint);
  31.                          }
  32.                      }
  33.                    if(!block[k][t].判断是否是雷()&&correct&&block[k][t].isOpaque()
  34.                        &&block[k][t].获取探雷标记()!=0)
  35.                      {
  36.                        Point addPoint=new Point(k,t);
  37.                        if(!(area.contains(addPoint)))
  38.                          {
  39.                            area.add(addPoint);
  40.                          }
  41.                      }
  42.                  }
  43.                 
  44.                }
  45.            } 
  46.         return area;
  47.   }
  48. }