richelbilderbeek / djog_unos_2018

Project by the Uno's at DJOG 2018-2019: Nature Zen
GNU General Public License v3.0
6 stars 2 forks source link

Simplify 'create_default_tiles' #558

Closed richelbilderbeek closed 5 years ago

richelbilderbeek commented 5 years ago

Is your feature request related to a problem? Please describe.

Currently, create_default_tiles looks like this:

std::vector<tile> create_default_tiles() noexcept //!OCLINT indeed a function that is too long
{
  std::vector<tile> tiles;
  {tile t(2, 8, 0, 0, 0, tile_type::arctic, tile_id());tiles.push_back(t);}
  {tile t(4, 7, 0, 90, 0, tile_type::arctic, tile_id());tiles.push_back(t);}
  //...
  return tiles;
}

This can be simplified to:

std::vector<tile> create_default_tiles() noexcept //!OCLINT indeed a function that is too long
{
  return
  {
    tile t(2, 8, 0, 0, 0, tile_type::arctic),
    tile t(4, 7, 0, 90, 0, tile_type::arctic),
    //...
  };
}

Describe the solution you'd like

Do the simplification.

All tests must keep passing.

Describe alternatives you've considered

None.

Additional context

None.

richelbilderbeek commented 5 years ago

Well done :+1: