Example #1
0
        public void Rotate(bool bClock)
        {
            List <int> lList = new List <int>();

            mOrient = PreRotate(bClock, ref lList);
            mListBlocks[0].Rotate(lList[0], lList[1]);
            mListBlocks[1].Rotate(lList[2], lList[3]);
            mListBlocks[2].Rotate(lList[4], lList[5]);
            mListBlocks[3].Rotate(lList[6], lList[7]);
        }
Example #2
0
        public CardGroup(ICanvasProvider canvasFacade, NormalizedPosition origin, Common.Orientation orientation)
        {
            _canvasFacade      = canvasFacade;
            _displayCards      = new List <UniqueDisplayCard>();
            Origin             = origin;
            _orientation       = orientation;
            OrientationDegress = (double)orientation;
            _curZIndex         = 0;

            // async initialization from canvas facade
            _canvasFacade.GetNormalizedCardImageSize().ContinueWith(task => _cardImageSize = task.Result);
        }
Example #3
0
        public override Common.Orientation PreRotate(bool bClock, ref List <int> nPos)
        {
            Common.Orientation lTemp = bClock ? (Common.Orientation)((int)(mOrient + 1) % 4) : (Common.Orientation)((int)(mOrient - 1 + 4) % 4);
            switch (lTemp)
            {
            case Common.Orientation.ORIENT_0:
                nPos.Add(0); nPos.Add(0);
                nPos.Add(1); nPos.Add(0);
                nPos.Add(1); nPos.Add(-1);
                nPos.Add(0); nPos.Add(-1);
                break;

            case Common.Orientation.ORIENT_1:
                nPos.Add(0); nPos.Add(0);
                nPos.Add(-1); nPos.Add(0);
                nPos.Add(-1); nPos.Add(-1);
                nPos.Add(0); nPos.Add(-1);
                break;

            case Common.Orientation.ORIENT_2:
                nPos.Add(0); nPos.Add(0);
                nPos.Add(-1); nPos.Add(0);
                nPos.Add(-1); nPos.Add(1);
                nPos.Add(0); nPos.Add(1);

                break;

            case Common.Orientation.ORIENT_3:
                nPos.Add(0); nPos.Add(0);
                nPos.Add(1); nPos.Add(0);
                nPos.Add(1); nPos.Add(1);
                nPos.Add(0); nPos.Add(1);

                break;

            default:
                break;
            }

            return(lTemp);
        }
        public InteractiveAdjacentCardGroup(GamePage parent, NormalizedPosition origin, Common.Orientation orientation)
            : base(parent, origin, orientation)
        {
            EndInteractiveSession();

            // bind callbacks to handlers
            _canvasFacade.CardClicked        += OnCardClicked;
            _canvasFacade.CardPointerEntered += OnCardPointerEntered;
            _canvasFacade.CardPointerExited  += OnCardPointerExited;
        }
Example #5
0
 public StackCardGroup(GamePage parent, NormalizedPosition origin, Common.Orientation orientation)
     : base(parent, origin, orientation)
 {
 }