public boolean isLegalDeployment(Coords c,int nDir){
  if ((c == null) || !contains(c)) {
    return false;
  }
  int nLimit=3;
  int minx=0;
  int maxx=width;
  int miny=0;
  int maxy=height;
  if (nDir > 10) {
    nDir-=10;
    minx=width / 5;
    maxx-=width / 5;
    miny=height / 5;
    maxy-=height / 5;
    if ((c.getX() < minx) || (c.getY() < miny) || (c.getX() >= maxx)|| (c.getY() >= maxy)) {
      return false;
    }
  }
switch (nDir) {
case START_ANY:
    return true;
case START_NW:
  return ((c.getX() < (minx + nLimit)) && (c.getX() >= minx) && (c.getY() < (height / 2))) || ((c.getY() < (miny + nLimit)) && (c.getY() >= miny) && (c.getX() < (width / 2)));
case START_N:
return (c.getY() < (miny + nLimit)) && (c.getY() >= miny);
case START_NE:
return ((c.getX() > (maxx - nLimit)) && (c.getX() < maxx) && (c.getY() < (height / 2))) || ((c.getY() < (miny + nLimit)) && (c.getY() >= miny) && (c.getX() > (width / 2)));
case START_E:
return (c.getX() >= (maxx - nLimit)) && (c.getX() < maxx);
case START_SE:
return ((c.getX() >= (maxx - nLimit)) && (c.getX() < maxx) && (c.getY() > (height / 2))) || ((c.getY() >= (maxy - nLimit)) && (c.getY() < maxy) && (c.getX() > (width / 2)));
case START_S:
return (c.getY() >= (maxy - nLimit)) && (c.getY() < maxy);
case START_SW:
return ((c.getX() < (minx + nLimit)) && (c.getX() >= minx) && (c.getY() > (height / 2))) || ((c.getY() >= (maxy - nLimit)) && (c.getY() < maxy) && (c.getX() < (width / 2)));
case START_W:
return (c.getX() < (minx + nLimit)) && (c.getX() >= minx);
case START_EDGE:
return ((c.getX() < (minx + nLimit)) && (c.getX() >= minx)) || ((c.getY() < (miny + nLimit)) && (c.getY() >= miny)) || ((c.getX() >= (maxx - nLimit)) && (c.getX() < maxx))|| ((c.getY() >= (maxy - nLimit)) && (c.getY() < maxy));
case START_CENTER:
return (c.getX() >= (width / 3)) && (c.getX() <= ((2 * width) / 3)) && (c.getY() >= (height / 3))&& (c.getY() <= ((2 * height) / 3));
default :
return false;
}
}

public boolean isLegalDeployment ( Coords c , int nDir ) { if ( ( c == null ) || ! contains ( c ) ) { return false ; } int nLimit = 3 ; int minx = 0 ; int maxx = width ; int miny = 0 ; int maxy = height ; if ( nDir > 10 ) { nDir -= 10 ; minx = width / 5 ; maxx -= width / 5 ; miny = height / 5 ; maxy -= height / 5 ; if ( ( c . getX ( ) < minx ) || ( c . getY ( ) < miny ) || ( c . getX ( ) >= maxx ) || ( c . getY ( ) >= maxy ) ) { return false ; } } switch ( nDir ) { case START_ANY : return true ; case START_NW : return ( ( c . getX ( ) < ( minx + nLimit ) ) && ( c . getX ( ) >= minx ) && ( c . getY ( ) < ( height / 2 ) ) ) || ( ( c . getY ( ) < ( miny + nLimit ) ) && ( c . getY ( ) >= miny ) && ( c . getX ( ) < ( width / 2 ) ) ) ; case START_N : return ( c . getY ( ) < ( miny + nLimit ) ) && ( c . getY ( ) >= miny ) ; case START_NE : return ( ( c . getX ( ) > ( maxx - nLimit ) ) && ( c . getX ( ) < maxx ) && ( c . getY ( ) < ( height / 2 ) ) ) || ( ( c . getY ( ) < ( miny + nLimit ) ) && ( c . getY ( ) >= miny ) && ( c . getX ( ) > ( width / 2 ) ) ) ; case START_E : return ( c . getX ( ) >= ( maxx - nLimit ) ) && ( c . getX ( ) < maxx ) ; case START_SE : return ( ( c . getX ( ) >= ( maxx - nLimit ) ) && ( c . getX ( ) < maxx ) && ( c . getY ( ) > ( height / 2 ) ) ) || ( ( c . getY ( ) >= ( maxy - nLimit ) ) && ( c . getY ( ) < maxy ) && ( c . getX ( ) > ( width / 2 ) ) ) ; case START_S : return ( c . getY ( ) >= ( maxy - nLimit ) ) && ( c . getY ( ) < maxy ) ; case START_SW : return ( ( c . getX ( ) < ( minx + nLimit ) ) && ( c . getX ( ) >= minx ) && ( c . getY ( ) > ( height / 2 ) ) ) || ( ( c . getY ( ) >= ( maxy - nLimit ) ) && ( c . getY ( ) < maxy ) && ( c . getX ( ) < ( width / 2 ) ) ) ; case START_W : return ( c . getX ( ) < ( minx + nLimit ) ) && ( c . getX ( ) >= minx ) ; case START_EDGE : return ( ( c . getX ( ) < ( minx + nLimit ) ) && ( c . getX ( ) >= minx ) ) || ( ( c . getY ( ) < ( miny + nLimit ) ) && ( c . getY ( ) >= miny ) ) || ( ( c . getX ( ) >= ( maxx - nLimit ) ) && ( c . getX ( ) < maxx ) ) || ( ( c . getY ( ) >= ( maxy - nLimit ) ) && ( c . getY ( ) < maxy ) ) ; case START_CENTER : return ( c . getX ( ) >= ( width / 3 ) ) && ( c . getX ( ) <= ( ( 2 * width ) / 3 ) ) && ( c . getY ( ) >= ( height / 3 ) ) && ( c . getY ( ) <= ( ( 2 * height ) / 3 ) ) ; default : return false ; } }
can the player deploy an entity here ? there are no canon rules for the deployment phase ( ? ! ) . i ' m using 3 hexes from map edge .
