Help with interfaces/ inheritance
Hello im building a game where I'll have a board and GamePiece's that will be placed on the board,
I have tokens, these can be placed on the board after some validation and they can't be moved once placed for the rest of the game
I have totems, these will be automatically be placed in the center at the start of the game and they can be moved afterwards
I need a way to distinguish between them so:
1- Inheritance ? Bad choice of using inheritance in here because I'm not needing hierarchical use of methods in gamepiece it would only be to extends from GamePiece and call the super constructor in the constructor for both cases, so im only using it for subtyping, which is bad practice
I don't know what other option there might be for this, any help designing this ?
I have tokens, these can be placed on the board after some validation and they can't be moved once placed for the rest of the game
I have totems, these will be automatically be placed in the center at the start of the game and they can be moved afterwards
I need a way to distinguish between them so:
1- Inheritance ? Bad choice of using inheritance in here because I'm not needing hierarchical use of methods in gamepiece it would only be to extends from GamePiece and call the super constructor in the constructor for both cases, so im only using it for subtyping, which is bad practice
I don't know what other option there might be for this, any help designing this ?