While building maps, the user tends to run into situations where they need more than just a tile being placed where the mouse clicks. It would definitely be useful to have tools that would enable them to freely pan around, select chunks of the map for deletion or copying, erase them and so on. Our control class is going to serve this exact purpose. It will provide a set of tools that can be used for multiple different situations:
enum class ControlMode{None, Pan, Brush, Bucket, Eraser, Select};
The preceding control mode enumeration represents a couple of the most common tools that come in a variety of different pieces of software. We're going to implement some of them here, and leave the rest up to you! In the end, we should have a control interface that looks a little like this:
Let us get to actually writing out the header for the control class. For clarity, we are going to be discussing its methods and data members separately, starting with the member...