Skip to content

Commit

Permalink
rename death_screen to end_screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Fris0uman committed Jun 30, 2024
1 parent 0ab0bf7 commit e7b43a2
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 45 deletions.
38 changes: 0 additions & 38 deletions src/death_screen.cpp

This file was deleted.

38 changes: 38 additions & 0 deletions src/end_screen.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include "assign.h"
#include "condition.h"
#include "death_screen.h"

Check failure on line 3 in src/end_screen.cpp

View workflow job for this annotation

GitHub Actions / Basic Build and Test (Clang 10, Ubuntu, Curses)

'death_screen.h' file not found
#include "generic_factory.h"

namespace
{
generic_factory<end_screen> end_screen_factory( "end_screen" );
} // namespace

template<>
const end_screen &string_id<end_screen>::obj()const
{
return end_screen_factory.obj( *this );
}

template<>
bool string_id<end_screen>::is_valid() const
{
return end_screen_factory.is_valid( *this );
}

void end_screen::load_death_screen( const JsonObject &jo, const std::string &src )
{
end_screen_factory.load( jo, src );
}

void end_screen::load( const JsonObject &jo, std::string_view )
{
mandatory( jo, was_loaded, "id", id );
mandatory( jo, was_loaded, "picture_id", picture_id );
read_condition( jo, "condition", condition, false );
}

const std::vector<end_screen> &end_screen::get_all()
{
return end_screen_factory.get_all();
}
6 changes: 3 additions & 3 deletions src/death_screen.h → src/end_screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

class JsonObject;

class death_screen
class end_screen
{
public:
static void load_death_screen( const JsonObject &jo, const std::string &src );

void load( const JsonObject &jo, std::string_view );
static const std::vector<death_screen>& get_all();
static const std::vector<end_screen>& get_all();
bool was_loaded = false;

death_screen_id id;
end_screen_id id;
ascii_art_id picture_id;
std::function<bool( dialogue & )> condition;
};
Expand Down
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void DynamicDataLoader::initialize()
add( "scent_type", &scent_type::load_scent_type );
add( "disease_type", &disease_type::load_disease_type );
add( "ascii_art", &ascii_art::load_ascii_art );
add( "death_screen", &death_screen::load_death_screen );
add( "end_screen", &end_screen::load_death_screen );

// json/colors.json would be listed here, but it's loaded before the others (see init_colors())
// Non Static Function Access
Expand Down
6 changes: 3 additions & 3 deletions src/type_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ using damage_type_id = string_id<damage_type>;
struct damage_info_order;
using damage_info_order_id = string_id<damage_info_order>;

struct death_screen;
using death_screen_id = string_id<death_screen>;

class disease_type;
using diseasetype_id = string_id<disease_type>;

Expand All @@ -91,6 +88,9 @@ using emit_id = string_id<emit>;
class enchantment;
using enchantment_id = string_id<enchantment>;

struct end_screen;
using end_screen_id = string_id<end_screen>;

class event_statistic;
using event_statistic_id = string_id<event_statistic>;

Expand Down

0 comments on commit e7b43a2

Please sign in to comment.