summaryrefslogtreecommitdiff
path: root/blc2/constants.py
blob: 792a8773e422aab3c71d14d5782acd62d04a378a (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""Constants module. 

Contains some constants used throughout. 
"""

class _Infinity:
    """Class for the singleton INFTY.

    We assume that this is only used in time-related operations, i.e. that numbers involved
    are nonnegative.
    """
    INFTY = None

    def __repr__(self):
        return "infty"

    def __str__(self):
        return "infty"

    def __gt__(self, other):
        return True

    def __lt__(self, other):
        return False

    def __add__(self, other):
        return self

    def __radd__(self, other):
        return self

    def __sub__(self, other):
        return self

    def __rsub__(self, other):
        return self

    def __mul__(self, other):
        if other == 0:
            return 0
        return self

    def __rmul__(self, other):
        if other == 0:
            return 0
        return self

    def __init__(self):
        if _Infinity.INFTY is not None:
            raise ValueError("Cannot create two infinities")
        _Infinity.INFTY = self

INFTY = _Infinity()

AUTO = -2

BXW = "{http://unsuspicious.services/bxw}"

SCENE = "Scene"
AUDIO = "Audio"
CHASER = "Chaser"
CHASERSTEP = "ChaserStep"
FUNCTION = "Function"

INTERNAL = "Internal"
EXTERNAL = "External"

INHERIT = "Inherit"
MANUAL = "Manual"