zain
05/11/2021, 8:57 AMopen class Player(override val playerName: String, override val id: Int) : FantasyPlayer
data class TeamPlayer(
override val playerName: String,
override val id: Int,
val teamId: Int,
val isCaptain: Boolean = false,
val isSelected: Boolean = false
) : Player(playerName, id)
So, I have a player object and I want to create instance of another class which is actually extended from the base
and I want to copy all the property values to this extended class, is this the correct approach or is it even possible\. For example,
val player = Player("Beckham", 1, 1)
val teamPlayer = TeamPlayer(// player, 10, true, true)
nkiesel
05/11/2021, 8:29 PMTeamPlayer
: see https://pl.kotl.in/rMtrAGczKzain
05/12/2021, 7:29 AMnkiesel
05/12/2021, 9:01 AM