示例#1
0
        private static void checkAndApply(InputAction action, BlockGrid grid, GameShape shape)
        {
            List <Block>   shapeBlocks         = shape.CalcBlocksPostAction(action);
            List <Vector2> occupiedCoordinates = grid.GetOccupiedCoordinates();
            bool           collision           = CheckForCollisions(grid, shapeBlocks, shape);

            CheckForCollisions(grid, shape.blocks, shape);
            if (!collision)
            {
                shape.ApplyAction(action);
            }
            checkAboutToPlace(shape.blocks, shape, occupiedCoordinates);
        }