mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 05:07:00 -04:00
Cleanup: use override specifier everywhere, and enable gcc warning to check for it.
This commit is contained in:
@@ -40,8 +40,8 @@ public:
|
||||
AddKeywordAction(Set& set);
|
||||
AddKeywordAction(AddingOrRemoving, Set& set, const KeywordP& keyword);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
const GenericAddAction<KeywordP> action;
|
||||
};
|
||||
@@ -75,9 +75,9 @@ public:
|
||||
Keyword& keyword; ///< The keyword we are the reminder text of
|
||||
|
||||
/// Try to compile the script
|
||||
virtual void store();
|
||||
void store() override;
|
||||
/// Add some tags, so the script looks nice
|
||||
virtual void retrieve();
|
||||
void retrieve() override;
|
||||
|
||||
/// Syntax highlight, and store in value
|
||||
void highlight(const String& code, const vector<ScriptParseError>& errors);
|
||||
@@ -91,8 +91,8 @@ class ChangeKeywordModeAction : public Action {
|
||||
public:
|
||||
ChangeKeywordModeAction(Keyword& keyword, const String& new_mode);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
//private:
|
||||
Keyword& keyword;
|
||||
|
||||
+16
-16
@@ -44,8 +44,8 @@ public:
|
||||
AddCardAction(AddingOrRemoving, Set& set, const CardP& card);
|
||||
AddCardAction(AddingOrRemoving, Set& set, const vector<CardP>& cards);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
const GenericAddAction<CardP> action;
|
||||
};
|
||||
@@ -57,8 +57,8 @@ class ReorderCardsAction : public CardListAction {
|
||||
public:
|
||||
ReorderCardsAction(Set& set, size_t card_id1, size_t card_id2);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
//private:
|
||||
const size_t card_id1, card_id2; ///< Positions of the two cards to swap
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
/// An action that affects the rendering/display/look of a set or cards in the set
|
||||
class DisplayChangeAction : public Action {
|
||||
public:
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
};
|
||||
|
||||
/// Changing the style of a a card
|
||||
@@ -78,8 +78,8 @@ class ChangeCardStyleAction : public DisplayChangeAction {
|
||||
public:
|
||||
ChangeCardStyleAction(const CardP& card, const StyleSheetP& stylesheet);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
//private:
|
||||
CardP card; ///< The affected card
|
||||
@@ -93,8 +93,8 @@ class ChangeSetStyleAction : public DisplayChangeAction {
|
||||
public:
|
||||
ChangeSetStyleAction(Set& set, const CardP& card);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
Set& set; ///< The affected set
|
||||
@@ -109,8 +109,8 @@ class ChangeCardHasStylingAction : public DisplayChangeAction {
|
||||
public:
|
||||
ChangeCardHasStylingAction(Set& set, const CardP& card);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
//private:
|
||||
Set& set; ///< The set to copy styling from
|
||||
@@ -136,8 +136,8 @@ public:
|
||||
/// Add a newly allocated card
|
||||
AddPackAction(AddingOrRemoving, Set& set, const PackTypeP& pack);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
const GenericAddAction<PackTypeP> action;
|
||||
};
|
||||
@@ -148,8 +148,8 @@ public:
|
||||
/// Add a newly allocated card
|
||||
ChangePackAction(Set& set, size_t pos, const PackTypeP& new_pack);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
PackTypeP pack;
|
||||
|
||||
+28
-28
@@ -40,8 +40,8 @@ class SymbolPartMoveAction : public SymbolPartsAction {
|
||||
public:
|
||||
SymbolPartMoveAction(const set<SymbolPartP>& parts, const Vector2D& delta = Vector2D());
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// Update this action to move some more
|
||||
void move(const Vector2D& delta);
|
||||
@@ -80,8 +80,8 @@ class SymbolPartRotateAction : public SymbolPartMatrixAction {
|
||||
public:
|
||||
SymbolPartRotateAction(const set<SymbolPartP>& parts, const Vector2D& center);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// Update this action to rotate to a different angle
|
||||
void rotateTo(Radians newAngle);
|
||||
@@ -103,8 +103,8 @@ class SymbolPartShearAction : public SymbolPartMatrixAction {
|
||||
public:
|
||||
SymbolPartShearAction(const set<SymbolPartP>& parts, const Vector2D& center);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// Change shear by a given amount
|
||||
void move(const Vector2D& deltaShear);
|
||||
@@ -126,8 +126,8 @@ class SymbolPartScaleAction : public SymbolPartsAction {
|
||||
public:
|
||||
SymbolPartScaleAction(const set<SymbolPartP>& parts, int scaleX, int scaleY);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// Change min and max coordinates
|
||||
void move(const Vector2D& delta_min, const Vector2D& delta_max);
|
||||
@@ -157,8 +157,8 @@ public:
|
||||
// All parts must be SymbolParts
|
||||
CombiningModeAction(const set<SymbolPartP>& parts, SymbolShapeCombine mode);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
void add(const SymbolPartP&, SymbolShapeCombine mode);
|
||||
@@ -172,9 +172,9 @@ class SymbolPartNameAction : public SymbolPartAction {
|
||||
public:
|
||||
SymbolPartNameAction(const SymbolPartP& part, const String& name, size_t old_cursor, size_t new_cursor);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
virtual bool merge(const Action& action);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
bool merge(const Action& action) override;
|
||||
|
||||
public:
|
||||
SymbolPartP part; ///< Affected part
|
||||
@@ -190,8 +190,8 @@ class AddSymbolPartAction : public SymbolPartListAction {
|
||||
public:
|
||||
AddSymbolPartAction(Symbol& symbol, const SymbolPartP& part);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
Symbol& symbol; ///< Symbol to add the part to
|
||||
@@ -205,8 +205,8 @@ class RemoveSymbolPartsAction : public SymbolPartListAction {
|
||||
public:
|
||||
RemoveSymbolPartsAction(Symbol& symbol, const set<SymbolPartP>& parts);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
Symbol& symbol;
|
||||
@@ -234,8 +234,8 @@ class DuplicateSymbolPartsAction : public SymbolPartListAction {
|
||||
public:
|
||||
DuplicateSymbolPartsAction(Symbol& symbol, const set<SymbolPartP>& parts);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// Fill a set with all the new parts
|
||||
void getParts(set<SymbolPartP>& parts);
|
||||
@@ -254,8 +254,8 @@ class ReorderSymbolPartsAction : public SymbolPartListAction {
|
||||
public:
|
||||
ReorderSymbolPartsAction(SymbolGroup& old_parent, size_t old_position, SymbolGroup& new_parent, size_t new_position);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
SymbolGroup* old_parent, *new_parent;///< Parents to move from and to
|
||||
@@ -269,8 +269,8 @@ public:
|
||||
/// Remove all the given groups
|
||||
UngroupReorderSymbolPartsAction(SymbolGroup& group_parent, size_t group_pos, SymbolGroup& target_parent, size_t target_pos);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
SymbolGroup& group_parent;
|
||||
@@ -287,11 +287,11 @@ class GroupSymbolPartsActionBase : public SymbolPartListAction {
|
||||
public:
|
||||
GroupSymbolPartsActionBase(SymbolGroup& root);
|
||||
|
||||
virtual void perform(bool to_undo);
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
protected:
|
||||
SymbolGroup& root; ///< Symbol or group to group stuff in
|
||||
vector<SymbolPartP> old_part_list; ///< Old part list of the symbol
|
||||
SymbolGroup& root; ///< Symbol or group to group stuff in
|
||||
vector<SymbolPartP> old_part_list; ///< Old part list of the symbol
|
||||
};
|
||||
|
||||
/// Group multiple symbol parts together
|
||||
@@ -299,7 +299,7 @@ class GroupSymbolPartsAction : public GroupSymbolPartsActionBase {
|
||||
public:
|
||||
GroupSymbolPartsAction(SymbolGroup& root, const set<SymbolPartP>& parts, const SymbolGroupP& group);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
String getName(bool to_undo) const override;
|
||||
private:
|
||||
SymbolGroupP group;
|
||||
};
|
||||
@@ -310,6 +310,6 @@ public:
|
||||
/// Remove all the given groups
|
||||
UngroupSymbolPartsAction(SymbolGroup& root, const set<SymbolPartP>& groups);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
String getName(bool to_undo) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -304,8 +304,8 @@ class SinglePointRemoveAction : public Action, public IntrusivePtrBase<SinglePoi
|
||||
public:
|
||||
SinglePointRemoveAction(const SymbolShapeP& shape, UInt position);
|
||||
|
||||
virtual String getName(bool to_undo) const { return _("Delete point"); }
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override { return _("Delete point"); }
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
SymbolShapeP shape;
|
||||
@@ -390,8 +390,8 @@ class ControlPointRemoveAction : public Action {
|
||||
public:
|
||||
ControlPointRemoveAction(const SymbolShapeP& shape, const set<ControlPointP>& to_delete);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
vector<SinglePointRemoveActionP> removals;
|
||||
|
||||
@@ -54,8 +54,8 @@ class ControlPointMoveAction : public ExtendableAction {
|
||||
public:
|
||||
ControlPointMoveAction(const set<ControlPointP>& points);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// Update this action to move some more
|
||||
void move(const Vector2D& delta);
|
||||
@@ -76,8 +76,8 @@ class HandleMoveAction : public ExtendableAction {
|
||||
public:
|
||||
HandleMoveAction(const SelectedHandle& handle);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// Update this action to move some more
|
||||
void move(const Vector2D& delta);
|
||||
@@ -115,8 +115,8 @@ class SegmentModeAction : public Action {
|
||||
public:
|
||||
SegmentModeAction(const ControlPointP& p1, const ControlPointP& p2, SegmentMode mode);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
protected:
|
||||
ControlPointUpdate point1, point2;
|
||||
@@ -129,8 +129,8 @@ class LockModeAction : public Action {
|
||||
public:
|
||||
LockModeAction(const ControlPointP& p, LockMode mode);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
ControlPointUpdate point; ///< The affected point
|
||||
@@ -145,9 +145,9 @@ class CurveDragAction : public SegmentModeAction {
|
||||
public:
|
||||
CurveDragAction(const ControlPointP& point1, const ControlPointP& point2);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
// Move the curve by this much, it is grabbed at time t
|
||||
void move(const Vector2D& delta, double t);
|
||||
};
|
||||
@@ -160,8 +160,8 @@ public:
|
||||
/// Insert a new point in shape, after position insertAfter_, at the time t on the segment
|
||||
ControlPointAddAction(const SymbolShapeP& shape, UInt insert_after, double t);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
inline ControlPointP getNewPoint() const { return new_point; }
|
||||
|
||||
@@ -188,8 +188,8 @@ class SymmetryMoveAction : public Action {
|
||||
public:
|
||||
SymmetryMoveAction(SymbolSymmetry& symmetry, bool is_handle);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// Update this action to move some more
|
||||
void move(const Vector2D& delta);
|
||||
@@ -211,8 +211,8 @@ class SymmetryTypeAction : public Action {
|
||||
public:
|
||||
SymmetryTypeAction(SymbolSymmetry& symmetry, SymbolSymmetryType type);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
private:
|
||||
SymbolSymmetry& symmetry;
|
||||
SymbolSymmetryType type;
|
||||
@@ -227,8 +227,8 @@ class SymmetryCopiesAction : public Action {
|
||||
public:
|
||||
SymmetryCopiesAction(SymbolSymmetry& symmetry, int copies);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
private:
|
||||
SymbolSymmetry& symmetry;
|
||||
int copies;
|
||||
|
||||
@@ -59,13 +59,13 @@ public:
|
||||
: ValueAction(value), new_value(new_value)
|
||||
{}
|
||||
|
||||
virtual void perform(bool to_undo) {
|
||||
void perform(bool to_undo) override {
|
||||
ValueAction::perform(to_undo);
|
||||
swap_value(static_cast<T&>(*valueP), new_value);
|
||||
valueP->onAction(*this, to_undo); // notify value
|
||||
}
|
||||
|
||||
virtual bool merge(const Action& action) {
|
||||
bool merge(const Action& action) override {
|
||||
if (!ALLOW_MERGE) return false;
|
||||
TYPE_CASE(action, SimpleValueAction) {
|
||||
if (action.valueP == valueP) {
|
||||
|
||||
+16
-16
@@ -40,8 +40,8 @@ public:
|
||||
: valueP(value), card(nullptr), old_time_modified(wxDateTime::Now())
|
||||
{}
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
/// We know that the value is on the given card, add that information
|
||||
void isOnCard(Card* card);
|
||||
@@ -69,9 +69,9 @@ class TextValueAction : public ValueAction {
|
||||
public:
|
||||
TextValueAction(const TextValueP& value, size_t start, size_t end, size_t new_end, const Defaultable<String>& new_value, const String& name);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
virtual bool merge(const Action& action);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
bool merge(const Action& action) override;
|
||||
|
||||
inline const String& newValue() const { return new_value(); }
|
||||
|
||||
@@ -99,10 +99,10 @@ class TextToggleReminderAction : public ValueAction {
|
||||
public:
|
||||
TextToggleReminderAction(const TextValueP& value, size_t pos);
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
private:
|
||||
private:
|
||||
size_t pos; ///< Position of "<kw-"
|
||||
bool enable; ///< Should the reminder text be turned on or off?
|
||||
wxUniChar old; ///< Old value of the <kw- tag
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
class SimpleTextValueAction : public ValueAction {
|
||||
public:
|
||||
SimpleTextValueAction(const Card* card, const TextValueP& value, const Defaultable<String>& new_value);
|
||||
virtual void perform(bool to_undo);
|
||||
void perform(bool to_undo) override;
|
||||
bool merge(const SimpleTextValueAction& action);
|
||||
private:
|
||||
Defaultable<String> new_value;
|
||||
@@ -125,8 +125,8 @@ class ReplaceAllAction : public Action {
|
||||
public:
|
||||
~ReplaceAllAction();
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
vector<SimpleTextValueAction> actions;
|
||||
};
|
||||
@@ -137,9 +137,9 @@ public:
|
||||
class ScriptValueEvent : public Action {
|
||||
public:
|
||||
inline ScriptValueEvent(const Card* card, const Value* value) : card(card), value(value) {}
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
const Card* card; ///< Card the value is on
|
||||
const Value* value; ///< The modified value
|
||||
@@ -152,8 +152,8 @@ public:
|
||||
: stylesheet(stylesheet), style(style)
|
||||
{}
|
||||
|
||||
virtual String getName(bool to_undo) const;
|
||||
virtual void perform(bool to_undo);
|
||||
String getName(bool to_undo) const override;
|
||||
void perform(bool to_undo) override;
|
||||
|
||||
const StyleSheet* stylesheet; ///< StyleSheet the style is for
|
||||
const Style* style; ///< The modified style
|
||||
|
||||
Reference in New Issue
Block a user