示例#1
0
        private void ProcessTouchEnter(StoneController s)
        {
            if (!_isTouchDown || _selectedStone == null)
            {
                return;
            }
            _isTouchDown = false;

            var f = _selectedStone;

            _selectedStone = null;
            SendTouchEvent(f, s);
        }
示例#2
0
 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);
     }
 }
示例#3
0
 private void ProcessTouchUp(StoneController s) => _isTouchDown = false;
示例#4
0
 private void SendTouchEvent(StoneController lhv, StoneController rhv) => _game.SwapStones(lhv.Pos, rhv.Pos);
示例#5
0
 public TouchEvent(TouchState state, StoneController controller)
 {
     State = state;
     Controller = controller;
 }