cygni / snakebot-client-dotnet

1 stars 7 forks source link

GameSettings should be parsed by client on game start #5

Open farpoke opened 6 years ago

farpoke commented 6 years ago

The "About" page says

The rules are configurable per game, upon every game start the clients will be notified of the current game settings.

and the server does send the settings, but the SnakeClient does not parse them. Unless the bots are to assume default values it makes sense for the observer and bots to be notified of the current settings as they are received.


I've made a commit (f99d9b19a7bf42e3bfa928dfd1ffa52135c0bcfe) on my own fork to fix this but as this is an API change I'm hesitant to create a PR and will let someone else figure it out.

lenkan commented 6 years ago

Thank you for your feedback. It was removed at some stage and never restored. But it definitely makes sense to have it. I added a comment about the abstract method for it. To me it does not seem essential that a bot implements this method. Therefore I'd like it to be virtual. What do you think about that?

farpoke commented 6 years ago

It definitely would make sense for it to be an empty virtual. I'm pretty sure that's how I first wrote it and I can't think of a good reason it shouldn't have been like that.

On a somewhat related note I noticed that GameSettings is missing a bunch of parameters (see bf4fb9b61f70fe15ad5bd1163ebcb55bb2151424).

And if anyone is curious about why I care about this, I want to be able to run a local copy of the game to produce predictions.