Implementing Dimension

Dimension only needs to be able to hold two properties: width and height. As such, it is a perfect candidate for the utilization of a data class. Add the following private class to the TetrisView class:

private data class Dimension(val width: Int, val height: Int)

The preceding one-liner provides us with the properties, as well as the setter and getters we need for them.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.67.5