On 15/06/2017 15:43, Öö Tiib wrote:
> On Wednesday, 14 June 2017 14:53:48 UTC+3, JiiPee wrote:
>>
>> so it is fixed part of it. Its the points the player gets in one/current
>> game. Its there (currently) only for the purpose of the current game.
> Yes that is what I wrote that may be is not made in convenient way
> for features that I can imagine. Player can be in lot of games during
> his career. Player may be interested how well he did in games of the
> past. But if the points are in player then those will be overwritten by
> next game.
I guess you mean that better to have points outside the Player class. I
agree that might be a perfect way, but then that would increase the
complexity of the code quite a lot (as I would have to create a
structure to hold the points). thats why I put it there. Other reason
was that because I cannot see the Player being used in this program for
any other purposes than 1) playing a game 2) modifying its data. So I
chose in this case to just put it there to keep it simple as I cannot
see player used in any other ways in this program.
My idea was here that the Player contains all the information for the
player, game points being one.
If I use the player in more complex way then maybe better to separate in
the future.
It nicely walks there "for free" with the player - dont need to worry
that a player gets another players/wrong points.
>> sure if its not logical I ll change it. I ll think about this...
>> But a good topic to discuss, after I think about it.
>> Well it works pretty well like it is, but always good to make things
>> more logical.
> It is not bad logic. It is wrong abstraction layer. We do not expect
> a "game" to "hack bits of player" but to "provide context for playing".
> Interacting with game technically can result that some subset of bits
> of player change but it is not responsibility of game to deal with those
> bits.
Where would it go? As currently I have only 2 classes really: Game,
where the whole game is run and Player.
In main I create game-instance and thats it. Everything runs there.
Thats why it also modifies player.
Game means: the game is running. Its like a video game: when you swich
on the video game we can say that the game is running, right? or you
mean that the game only starts when the first move is done? evertyghing
before that does not belong to game (like adding player to the
game/modifying players data etc)?