Added list for refering to keyword parameters; keyword database updated when keywords change

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@270 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-04-20 16:10:54 +00:00
parent 0d3ab74d32
commit fef99c78e3
11 changed files with 120 additions and 113 deletions
+9 -19
View File
@@ -34,32 +34,22 @@ class KeywordListAction : public Action {
// therefore we don't need a smart pointer
};
/// Adding a new keyword to a set
enum Adding {ADD};
enum Removing {REMOVE};
/// Adding or removing a keyword from a set
class AddKeywordAction : public KeywordListAction {
public:
AddKeywordAction(Set& set);
AddKeywordAction(Set& set, const KeywordP& keyword);
AddKeywordAction(Adding, Set& set);
AddKeywordAction(Removing, Set& set, const KeywordP& keyword);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
//private:
const KeywordP keyword; ///< The new keyword
};
// ----------------------------------------------------------------------------- : Remove Keyword
/// Removing a keyword from a set
class RemoveKeywordAction : public KeywordListAction {
public:
RemoveKeywordAction(Set& set, const KeywordP& keyword);
virtual String getName(bool to_undo) const;
virtual void perform(bool to_undo);
//private:
const KeywordP keyword; ///< The removed keyword
const size_t keyword_id; ///< Position of the keyword in the set
const bool adding; ///< Was a keyword added? (as opposed to removed)
const KeywordP keyword; ///< The new/removed keyword
const size_t keyword_id; ///< Position of the keyword in the set
};
// ----------------------------------------------------------------------------- : Changing keywords