implemented most of DataEditor; fixed some bugs in Settings

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@78 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-11-20 00:09:09 +00:00
parent 040e87e938
commit ecf28b00a3
10 changed files with 288 additions and 28 deletions
+7 -2
View File
@@ -20,14 +20,19 @@
template <typename T>
class Defaultable {
public:
inline Defaultable() : is_default(true) {}
inline Defaultable(const T& v) : value(v), is_default(false) {}
inline Defaultable() : is_default(true) {}
inline Defaultable(const T& v, bool def = false) : value(v), is_default(def) {}
/// Assigning a value takes this object out of the default state
inline void assign(const T& new_value) {
value = new_value;
is_default = false;
}
/// Assigning a value keep this object in the default state
inline void assignDefault(const T& new_value) {
assert(is_default);
value = new_value;
}
/// Get access to the value
inline const T& operator () () const { return value; }