mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
46a6ed39dc
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@35 0fc631ac-6414-0410-93d0-97cfa31319b6
49 lines
1.6 KiB
C++
49 lines
1.6 KiB
C++
//+----------------------------------------------------------------------------+
|
|
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
|
|
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
|
|
//| License: GNU General Public License 2 or later (see file COPYING) |
|
|
//+----------------------------------------------------------------------------+
|
|
|
|
// ----------------------------------------------------------------------------- : Includes
|
|
|
|
#include <data/field/boolean.hpp>
|
|
|
|
// ----------------------------------------------------------------------------- : BooleanField
|
|
|
|
BooleanField::BooleanField() {
|
|
choices->choices.push_back(new_shared1<Choice>(_("yes")));
|
|
choices->choices.push_back(new_shared1<Choice>(_("no")));
|
|
choices->initIds();
|
|
}
|
|
|
|
StyleP BooleanField::newStyle(const FieldP& thisP) const {
|
|
return new_shared<BooleanStyle>();
|
|
}
|
|
|
|
ValueP BooleanField::newValue(const FieldP& thisP) const {
|
|
return new_shared<BooleanValue>();
|
|
}
|
|
|
|
String BooleanField::typeName() const {
|
|
return _("boolean");
|
|
}
|
|
|
|
IMPLEMENT_REFLECTION(BooleanField) {
|
|
REFLECT_BASE(Field); // NOTE: don't reflect as a ChoiceField
|
|
REFLECT(script);
|
|
REFLECT_N("default", default_script);
|
|
REFLECT(initial);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------------- : BooleanStyle
|
|
|
|
IMPLEMENT_REFLECTION(BooleanStyle) {
|
|
REFLECT_BASE(ChoiceStyle);
|
|
}
|
|
|
|
// ----------------------------------------------------------------------------- : BooleanValue
|
|
|
|
IMPLEMENT_REFLECTION_NAMELESS(BooleanValue) {
|
|
REFLECT_BASE(ChoiceValue);
|
|
}
|