Another dumb question: If a class contains data o...
# getting-started
j
Another dumb question: If a class contains data of an entity (Such as their position, etc.) would it be viable to just make it a data class? There is nothing in the constructor as everything within is practically modifiable fields to update things such as their current position.
d
sounds like a candidate for a
data class
to me. You can probably use this approach: https://pl.kotl.in/IIZFSE11m
this works as well: https://pl.kotl.in/bg-6FXofr
v
Why two constructors though? https://pl.kotl.in/ZN1VvP8Ob
d
i couldn’t even understand myself why I posted the solution with 2 constructors 🤷, hence the second link I posted….
v
Oh, somehow missed the second one o_O