Implementing a class which inherits properties of several interfaces

Report a typo

Suppose you've got a complex architecture of interfaces which derive from each other and are all being used in some classes. The Player class is supposed to implement a few of those interfaces, which, in turn, are derived from others. Your task is to provide a correct implementation of the Player class:

Note: it's up to you whether to implement the required properties as a constructor parameter or just in the body of the class.

Write a program in Kotlin
// Do not change the code below!

interface IMovable {
val externalEffect: Boolean
val selfEffect: Boolean
}

interface IMassive {
val mass: Int
var massMultiplier: Int
}

interface IControllable {
var currentlyControlled: Boolean
var controllers: Int
}

interface ISimulated : IMovable, IMassive {
var isSimulating: Boolean
}

interface Entity : ISimulated {
val entityId: Int
}

// Do not change the code above!

class Player(
//Your code here
) : Entity, IControllable
___

Create a free account to access the full topic