alexrintt / lichess.dart

Lichess client for Dart.
https://pub.dev/packages/lichess_client_dio
MIT License
6 stars 2 forks source link

Perf Gamemode value #23

Open riccardocescon opened 1 year ago

riccardocescon commented 1 year ago

Add a new value inside the Perf class. This value should be an enum (such as GameMode) with a .name parameter that gives the current gamemode name such as 'Classic', 'Blitz' and so on

alexrintt commented 1 year ago

I am not sure if it is good to put this inside the library. String values meant to be displayed should be handled by the application, not by the service, so you can handle multiple languages as your wish.

riccardocescon commented 1 year ago

I see, but at least It should have an enum rappresenting itself, without the .name parameters. Once you list all perf inside a list, you lose the type perf, because that's juste the name of the variabile.

E.g: perf = allPerfs.bullet

There Is no way ti know that perf Is now a bullet, If there's no enum inside the Perf classe the app would have to Always wrap perf with a classe with both that Perf and the enum

alexrintt commented 1 year ago

Okay, then i didn't understand you well, which class are you talking about?

riccardocescon commented 1 year ago

Perf class: https://github.com/alexrintt/lichess.dart/blob/8576a13ba885f5a5f1fb53908e8afbde58075ce0/packages/lichess_client/lib/src/models/common.dart#L64