Shared Function cardon(ByVal idx As Integer) As Boolean Return field(idx).num <> -1 End Function Shared Function calcPos(ByVal x As Integer, ByVal y As Integer, ByRef xp As Integer, ByRef yp As Integer) As Integer Dim idx As Integer = -1 x = x - offset If x < 10 OrElse 84 * 5 + 10 <= x _ OrElse y < 10 OrElse 124 * 5 + 10 <= y Then Return idx xp = CInt((x - 10) \ (CARD_WIDTH + 4)) yp = CInt((y - 10) \ (CARD_HEIGHT + 4)) idx = yp * 5 + xp Return idx End Function End Class