Skip to content

Commit 8468f86

Browse files
committed
eoc: nuke unused str_translation_or_var
1 parent 140271f commit 8468f86

File tree

3 files changed

+0
-42
lines changed

3 files changed

+0
-42
lines changed

src/condition.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -240,27 +240,6 @@ translation_or_var get_translation_or_var( const JsonValue &jv, std::string_view
240240
return ret;
241241
}
242242

243-
void str_translation_or_var::deserialize( JsonValue const &jv )
244-
{
245-
if( jv.test_object() ) {
246-
const JsonObject &jo = jv.get_object();
247-
if( jo.get_bool( "i18n", false ) ) {
248-
translation tov;
249-
mandatory( jo, false, "str", tov );
250-
val = translation_or_var{ tov };
251-
} else {
252-
jo.allow_omitted_members();
253-
str_or_var sov;
254-
sov.deserialize( jv );
255-
val = sov;
256-
}
257-
} else {
258-
str_or_var sov;
259-
sov.deserialize( jv );
260-
val = sov;
261-
}
262-
}
263-
264243
void var_info::deserialize( JsonValue const &jsin )
265244
{
266245
_deserialize( jsin.get_object() );

src/dialogue_helpers.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,6 @@ var_info process_variable( const std::string &type )
6464
return { vt, ret_str };
6565
}
6666

67-
std::string str_translation_or_var::evaluate( const_dialogue const &d, bool /* convert */ ) const
68-
{
69-
return std::visit( overloaded{
70-
[&d]( str_or_var const & tv ) -> std::string
71-
{
72-
return tv.evaluate( d );
73-
},
74-
[&d]( translation_or_var const & tv ) -> std::string
75-
{
76-
return tv.evaluate( d ).translated();
77-
},
78-
},
79-
val );
80-
}
81-
8267
namespace
8368
{
8469

src/dialogue_helpers.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,6 @@ extern template struct value_or_var<translation, string_mutator<translation>>;
144144
using str_or_var = value_or_var<std::string, string_mutator<std::string>>;
145145
using translation_or_var = value_or_var<translation, string_mutator<translation>>;
146146

147-
struct str_translation_or_var {
148-
std::variant<str_or_var, translation_or_var> val;
149-
std::string evaluate( const_dialogue const &, bool convert = false ) const;
150-
void deserialize( JsonValue const &jv );
151-
};
152-
153147
struct talk_effect_fun_t {
154148
public:
155149
using likely_reward_t = std::pair<dbl_or_var, str_or_var>;

0 commit comments

Comments
 (0)