Designing a game is a complex task. We can consider game development as a separate programming area. Games have different genres, and one of them is strategy games. Strategy game design involves designing game components such as units and buildings. Usually, a strategy game involves collecting resources, building an empire, and fighting the enemy. The gameplay involves dynamic communication between game components, such as character units constructing buildings and collecting resources, soldiers defending the land from enemies, and so on.
To properly design a strategy game, we incorporate OOP design skills, along with design patterns. Design patterns play a huge role in designing the whole game and how its components interact. In this chapter, we discussed the Command pattern, which encapsulates actions under objects; the Observer pattern, which is used to subscribe to...