Пример #1
0
        private void MakeMove(Cell from, Cell to)
        {
            //Don't forget, that you must control the correctness of moves!
            //TODO: check the correctness.
            var fromBlockPosition = boardStorage.GetBlockPosition(from);
            var fromBlock         = boardStorage.GetBlock(fromBlockPosition);
            var currentBlock      = boardManager.GetCurrentBlock();

            if (fromBlock != currentBlock)
            {
                boardManager.SetActiveBlock(fromBlockPosition);
            }

            var positionFrom = boardStorage.GetPositionOnBoard(from);
            var positionTo   = boardStorage.GetPositionOnBoard(to);

            inputListener.ProcessBoardClick(positionFrom.x, positionFrom.y);
            inputListener.ProcessBoardClick(positionTo.x, positionTo.y);
        }