summaryrefslogtreecommitdiffstats
path: root/labb4/test-rule-of-three/main.hpp
blob: 5cd7ffb3ef10061656e4e66db4037481ed21ab1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
struct Base {
    virtual ~Base() {}
    virtual Base *clone() = 0;

    virtual void hello() = 0;
};

struct DerivedA : public Base {
    ~DerivedA() = default;
    Base *clone() override;

    void hello() override;
};

struct DerivedB : public Base {
    ~DerivedB() = default;
    Base *clone() override;

    void hello() override;
};

struct GameState {
    GameState();

    GameState(const GameState &other);
    GameState &operator=(const GameState &other);
    ~GameState();

    Base *thing;
    void switchThing();
};