Planning the selection options
Versatile selection options are important when creating a responsive and useful application. Without them, any sort of software can feel unintuitive, clunky, or unresponsive at best. In this particular case, we are going to be dealing with selecting, copying, and placing tiles, entities, and particle emitters.
Let us see what such an interface might look like:
In order to get there, we need to create a flexible class, designed to be able to handle any possible combination of options and controls. Let us start by going over the most basic data types that are going to come in handy when developing this system:
enum class SelectMode{ Tiles, Entities, Emitters }; using NameList = std::vector<std::pair<std::string, bool>>;
First, the selection mode needs to be enumerated. As shown in the preceding snippet, there are three modes we are going to be working with at the moment, although this list can easily be expanded in the future. The NameList
data type...