1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace bbiwarg.Detectors.Touch
- {
- class TouchEvent
- {
- private int x;
- private int y;
- private float touchValue;
- public TouchEvent(int x, int y, float touchValue) {
- this.x = x;
- this.y = y;
- this.touchValue = touchValue;
- }
- public int getX() {
- return x;
- }
- public int getY() {
- return y;
- }
- public float getTouchValue() {
- return touchValue;
- }
- 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;
- }
- }
- }
|