File size: 459 Bytes
46a9f18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class StateController:

    WRITING_MODE = 0
    ERASE_MODE = 1
    CALCULATOR_MODE = 2

    def __init__(self):
        self.state = self.WRITING_MODE

    def set_mode(self, new_state):
        self.state = new_state

    def is_writing(self):
        return self.state == self.WRITING_MODE

    def is_erasing(self):
        return self.state == self.ERASE_MODE

    def is_calc(self):
        return self.state == self.CALCULATOR_MODE