Added clone() function to Value.

Added support for per-card styling

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@430 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-06-24 01:30:34 +00:00
parent df9bb78e51
commit f0628317a3
25 changed files with 147 additions and 21 deletions
+9 -6
View File
@@ -91,6 +91,14 @@ StyleSheetP Set::stylesheetForP(const CardP& card) {
else return stylesheet;
}
IndexMap<FieldP, ValueP>& Set::stylingDataFor(const StyleSheet& stylesheet) {
return styling_data.get(stylesheet.name(), stylesheet.styling_fields);
}
IndexMap<FieldP, ValueP>& Set::stylingDataFor(const CardP& card) {
if (card && card->has_styling) return card->styling_data;
else return stylingDataFor(stylesheetFor(card));
}
String Set::typeName() const { return _("set"); }
// fix values for versions < 0.2.7
@@ -144,6 +152,7 @@ IMPLEMENT_REFLECTION(Set) {
}
WITH_DYNAMIC_ARG(game_for_reading, game.get());
REFLECT(stylesheet);
WITH_DYNAMIC_ARG(stylesheet_for_reading, stylesheet.get());
REFLECT_N("set_info", data);
if (stylesheet) {
REFLECT_N("styling", styling_data);
@@ -202,12 +211,6 @@ void Set::clearOrderCache() {
order_cache.clear();
}
// ----------------------------------------------------------------------------- : Styling
IndexMap<FieldP, ValueP>& Set::stylingDataFor(const StyleSheet& stylesheet) {
return styling_data.get(stylesheet.name(), stylesheet.styling_fields);
}
// ----------------------------------------------------------------------------- : SetView
SetView::SetView() {}