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

Remove tile_type::nonetile #513

Closed richelbilderbeek closed 5 years ago

richelbilderbeek commented 5 years ago

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

I've never observed a use of a null-type tile_type.

Take for example this line:

tile_type get_merge_type(tile_type type1, tile_type type2) noexcept
{
  // ...
  // Cannot find it
  return tile_type::nonetile;
}

The line above indicates that no tile type exists,

A superior way to indicate the same:

std::vector<tile_type> get_merge_type(tile_type type1, tile_type type2) noexcept

The std::vector will be empty if there is no tile_type.

I suggest to do ourselves a favour and remove tile_type::nonetile.

Describe the solution you'd like

Remove tile_type::nonetile. When a null-tile_tyoe is needed, use an empty std::vector<tile_type> instead.

Describe alternatives you've considered

None.

Additional context

None.

DynCoder commented 5 years ago

Replace the usages with grassland

Enzo9 commented 5 years ago

partially done, richel will finish it.

richelbilderbeek commented 5 years ago

Finished @Enzo9's work :shipit:!