uspgamedev / luasteam

Bindings to connect lua with Steam API
https://luasteam.readthedocs.io/en/stable/
MIT License
116 stars 19 forks source link

Leaderboards functions #3

Closed yancouto closed 5 years ago

yancouto commented 5 years ago

Added many leaderboard related functions. (They are being used on MarvInc :D)

Added functions:

Callbacks:

Other changes:

Kazuo256 commented 5 years ago

If the PR is not ready yet, it's better to put a "WIP" somewhere in its title ;)

yancouto commented 5 years ago

It's done now :P I had just noticed I forgot some stuff while I was writing the documentation so I tried to sneak some changes before the review :)

yancouto commented 5 years ago

Instead of always using brackets, I added a clang-format rule for putting if statements without brackets on the same line, and I'm using that for small if statements like

if (condition) return;

This way, there's no confusion because of indentation (and also there wouldn't be normally, since clang-format will indent everything properly).

For large single statements I'm still using braces, since it does look clearer.

if (condition) {
    this_is_a_very_large_statement(with_a_bunch_of_args);
}

Also, I didn't add the error messages since the API itself says they're kind of useless, but I'll add them later, once I do some refactoring.

henriquegemignani commented 5 years ago
if (condition) return;

This way, there's no confusion because of indentation (and also there wouldn't be normally, since clang-format will indent everything properly).

I prefer to have all return statements very clearly visible and not obscured by an if statement.

yancouto commented 5 years ago

Done.