コード例 #1
0
 public bool isSelected(Vector2 point, int angle, int distance)
 {
     angle *= 45;
     if (GameFunctions.isTheSame(GameFunctions.calcPos(point), getPosition()))
     {
         return(true);
     }
     else if (GameFunctions.isTheSame((GameFunctions.calcPos(point) + distance * GameFunctions.Vector2FromAngle(angle)), getPosition()))
     {
         return(true);
     }
     else if (GameFunctions.isTheSame((2 * GameFunctions.calcPos(point) + distance * GameFunctions.Vector2FromAngle(angle)), 2 * getPosition()))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }