Skip to content

Commit

Permalink
Minimal storage class for point constants
Browse files Browse the repository at this point in the history
  • Loading branch information
sparr committed Nov 15, 2024
1 parent 291a5a4 commit 764daf8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions src/coordinates.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,68 +289,68 @@ class coord_point_ob : public
// These definitions can go in the class in clang and gcc, and are much shorter there,
// but MSVC doesn't allow that, so...
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob<Point, Origin, Scale>::min =
coord_point_ob<Point, Origin, Scale>( Point::min );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob<Point, Origin, Scale>::max =
coord_point_ob<Point, Origin, Scale>( Point::max );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob<Point, Origin, Scale>::invalid =
coord_point_ob<Point, Origin, Scale>( Point::invalid );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob<Point, Origin, Scale>::zero =
coord_point_ob<Point, Origin, Scale>( Point::zero );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_rel<Point, Origin, Scale>::north
=
coord_point_ob<Point, Origin, Scale>( Point::north );
template<typename Point, origin Origin, scale Scale>
constexpr const coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_rel<Point, Origin, Scale>::north_east
=
coord_point_ob<Point, Origin, Scale>( Point::north_east );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_rel<Point, Origin, Scale>::east
=
coord_point_ob<Point, Origin, Scale>( Point::east );
template<typename Point, origin Origin, scale Scale>
constexpr const coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_rel<Point, Origin, Scale>::south_east
=
coord_point_ob<Point, Origin, Scale>( Point::south_east );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_rel<Point, Origin, Scale>::south
=
coord_point_ob<Point, Origin, Scale>( Point::south );
template<typename Point, origin Origin, scale Scale>
constexpr const coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_rel<Point, Origin, Scale>::south_west
=
coord_point_ob<Point, Origin, Scale>( Point::south_west );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_rel<Point, Origin, Scale>::west
=
coord_point_ob<Point, Origin, Scale>( Point::west );
template<typename Point, origin Origin, scale Scale>
constexpr const coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_rel<Point, Origin, Scale>::north_west
=
coord_point_ob<Point, Origin, Scale>( Point::north_west );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_3d<Point, Origin, Scale>::above
=
coord_point_ob<Point, Origin, Scale>( Point::above );
template<typename Point, origin Origin, scale Scale>
inline constexpr coord_point_ob<Point, Origin, Scale>
const coord_point_ob<Point, Origin, Scale>
coord_point_ob_3d<Point, Origin, Scale>::below
=
coord_point_ob<Point, Origin, Scale>( Point::below );
Expand Down
8 changes: 4 additions & 4 deletions tests/monster_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ TEST_CASE( "monsters_spawn_eggs", "[monster][reproduction]" )
{
clear_map();
map &here = get_map();
tripoint_bub_ms loc = get_avatar().pos_bub() + tripoint_east;
tripoint_bub_ms loc = get_avatar().pos_bub() + tripoint::east;
monster &test_monster = spawn_test_monster( "mon_dummy_reproducer_eggs", loc );
bool test_monster_spawns_eggs = false;
int amount_of_iteration = 0;
Expand All @@ -443,7 +443,7 @@ TEST_CASE( "monsters_spawn_egg_itemgroups", "[monster][reproduction]" )
{
clear_map();
map &here = get_map();
tripoint_bub_ms loc = get_avatar().pos_bub() + tripoint_east;
tripoint_bub_ms loc = get_avatar().pos_bub() + tripoint::east;
monster &test_monster = spawn_test_monster( "mon_dummy_reproducer_egg_group", loc );
bool test_monster_spawns_egg_group = false;
int amount_of_iteration = 0;
Expand All @@ -465,7 +465,7 @@ TEST_CASE( "monsters_spawn_babies", "[monster][reproduction]" )
{
clear_map();
creature_tracker &creatures = get_creature_tracker();
tripoint_bub_ms loc = get_avatar().pos_bub() + tripoint_east;
tripoint_bub_ms loc = get_avatar().pos_bub() + tripoint::east;
monster &test_monster = spawn_test_monster( "mon_dummy_reproducer_mon", loc );
bool test_monster_spawns_babies = false;
int amount_of_iteration = 0;
Expand All @@ -488,7 +488,7 @@ TEST_CASE( "monsters_spawn_baby_groups", "[monster][reproduction]" )
{
clear_map();
creature_tracker &creatures = get_creature_tracker();
tripoint_bub_ms loc = get_avatar().pos_bub() + tripoint_east;
tripoint_bub_ms loc = get_avatar().pos_bub() + tripoint::east;
monster &test_monster = spawn_test_monster( "mon_dummy_reproducer_mon_group", loc );
bool test_monster_spawns_baby_mongroup = false;
int amount_of_iteration = 0;
Expand Down

0 comments on commit 764daf8

Please sign in to comment.