using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using bbiwarg.Detectors.Fingers; namespace bbiwarg.Detectors.Touch { class TouchEvent { private int x; private int y; private float floodValue; private Finger finger; public TouchEvent(int x, int y, float floodValue, Finger finger) { this.x = x; this.y = y; this.floodValue = floodValue; this.finger = finger; } public int getX() { return x; } public int getY() { return y; } public float getFloodValue() { return floodValue; } public float getDistanceTo(TouchEvent te) { int xDiff = x - te.getX(); int yDiff = y - te.getY(); float distance = (float)Math.Sqrt(xDiff * xDiff + yDiff * yDiff); return distance; } public bool isSimilarTo(TouchEvent compareTouchEvent) { float maxDistance = 20; float distance = getDistanceTo(compareTouchEvent); return (distance < maxDistance); } } }