private void ProcessTouchEnter(StoneController s) { if (!_isTouchDown || _selectedStone == null) { return; } _isTouchDown = false; var f = _selectedStone; _selectedStone = null; SendTouchEvent(f, s); }
private void ProcessTouchDown(StoneController s) { _isTouchDown = true; if (_selectedStone == null || !IsNeighboringPositions(_selectedStone.Pos, s.Pos)) { _selectedStone = s; } else { var f = _selectedStone; _selectedStone = null; SendTouchEvent(f, s); } }
private void ProcessTouchUp(StoneController s) => _isTouchDown = false;
private void SendTouchEvent(StoneController lhv, StoneController rhv) => _game.SwapStones(lhv.Pos, rhv.Pos);
public TouchEvent(TouchState state, StoneController controller) { State = state; Controller = controller; }