-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.py
40 lines (36 loc) · 1.01 KB
/
state.py
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
38
39
40
# StateMachine/State.py
# A State has an operation, and can be moved
# into the next State given an Input:
class State:
def run(self):
assert 0, "run not implemented"
def next(self, input):
assert 0, "next not implemented"
#Base object called State() on which the states will inherit from
# class State(object):
# """
# We define a state object which provides some utility functions for the
# individual states within the state machine.
# """
#
# def __init__(self):
# print('Processing current state:', str(self))
#
# def on_event(self, event):
# """
# Handle events that are delegated to this State.
# """
# pass
#
# def __repr__(self):
# """
# Leverages the __str__ method to describe the State.
# """
# return self.__str__()
#
# def __str__(self):
# """
# Returns the name of the State.
# """
# return self.__class__.__name__
#can call repr(), str(), or State.__str__