Project

Profile

Help

Revision a5c338e8

Added by Vincent Le Goff almost 4 years ago

Put the macros and triggers in the world itself

View differences:

src/sharp/engine.py
42 42

  
43 43
    """
44 44

  
45
    def __init__(self, engine, client):
45
    def __init__(self, engine, client, world):
46 46
        self.engine = engine
47 47
        self.client = client
48
        self.world = world
48 49
        self.locals = {}
49 50
        self.globals = globals()
50 51

  
51 52
        # Adding the functions
52 53
        for name, function in FUNCTIONS.items():
53
            function = function(engine, client, self)
54
            function = function(engine, client, self, world)
54 55
            self.globals[name] = function.run
55 56

  
56 57
    def execute(self, code):

Also available in: Unified diff