-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcontroller.h
More file actions
37 lines (30 loc) · 758 Bytes
/
controller.h
File metadata and controls
37 lines (30 loc) · 758 Bytes
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
32
33
34
35
36
37
#pragma once
#include <string>
#include "Graph.h"
class Controller {
public:
virtual void on() = 0;
virtual void off() = 0;
virtual void set_level(int level) = 0;
virtual std::string show() const = 0;
};
class Test_controller : public Controller {
public:
void on() override;
void off() override;
void set_level(int level) override;
std::string show() const override;
private:
bool on_ = false;
int level_ = 0;
};
class Line_color_controller : public Controller {
public:
Line_color_controller(Graph_lib::Shape& shape) :shape_(shape) {}
void on() override;
void off() override;
void set_level(int level) override;
std::string show() const override;
private:
Graph_lib::Shape& shape_;
};