Lux-AI-Challenge / Lux-Design-S1

Home to the design and engine of the @Lux-AI-Challenge Season 1, hosted on @kaggle
https://lux-ai.org/
Apache License 2.0
897 stars 152 forks source link

Add missing const qualifiers, unify code style #163

Closed themmj closed 2 years ago

themmj commented 2 years ago

The first change adds the const qualifiers I mentioned in Discord.

The second change makes the code more readable and unifies the style. There were some redundant things (like unnecessary ;, using this-> and unneeded copy constructions) and some inconsistencies in style (initialization of members in the constructor body or as an initializer list and where the curly braces are placed). Also added some whitespace to aid in readability or fix indentation mismatches. Overall just adjusted parts of the code to be in line with the rest.

I've not touched main.cpp to avoid merge conflicts for users.

If you want me to remove the second change from the PR and only keep the Position.hpp changes feel free to tell me. I just thought it might help.

themmj commented 2 years ago

Added an explicit initialization of the CityTile pointer to fix #145

StoneT2000 commented 2 years ago

Code is ready to go! Just tested it on kaggle. Thanks!

themmj commented 2 years ago

@StoneT2000 In case you need help to prepare the cpp kit for another season or challenge, I'd be willing to contribute again.

StoneT2000 commented 2 years ago

Thanks! We will consider reaching out before launching the next year's challenge's kits. Are you on discord? @themmj

themmj commented 2 years ago

Sweet. Yes its MMJ#3534 , we already had a small convo in the questions channel about the const qualifiers.