Imagine we're involved in some kind of game development, and you're working on a fantasy-genre game, which involves defining statistics and actions for different characters, monsters, and NPCs...
The programmers of the team have provided you with a bunch of interfaces, such as Melee for the characters who attack with melee weapons, while the team's game designers (not very familiar with the programmers) created classes of in-game entities they would like to add, listing required functions and properties. The thing is, for the whole system to work, interfaces must be connected to game entities: therefore, your task is to check the functionality of the interfaces and add the interfaces to the list of inheritance or implementation of the provided classes. For example, the game designers made an Archer class:
class Archer: // ?
{
// Hm this seems to be a part of "Ranged" interface...
override var usesAmmo: Boolean = true
override var ammoAmount: Int = 20
override var hp: Int = 3
override var armorClass: Int = 10
// And that corresponds to "NPC"!
override val xp: Int = 5
override var location: String = "Camp"
}
Therefore, you'll need to add the following interfaces to the class:
class Archer: Ranged, NPC {
override var usesAmmo: Boolean = true
...