35.9. Example: Monopoly
First, let's briefly review the new domain rules and requirements in iteration-3: If a player lands on a property square (a lot, railroad, or utility) then they buy it if they have enough cash and it's not owned. If it is owned by another player, they pay rent according to square-specific rules.Let's also review the essential design, as shown in Figure 35.23 and Figure 35.24. Polymorphism is applied; for each kind of square that has a different landed-on behavior, there is a polymorphic landedOn method. When a Player software object lands on a Square , it sends it a landedOn message.