Dancing Hoskuld
Deity
As far as I can see that is not a standard BtS tag. It could be from Revolutions, or Dale's mods, orCould someone explain how iFlankingStrength works in Unitinfos?
As far as I can see that is not a standard BtS tag. It could be from Revolutions, or Dale's mods, orCould someone explain how iFlankingStrength works in Unitinfos?
I don't know it's origin but it is in C2C too. Sometimes it's 50, other times it's 100.As far as I can see that is not a standard BtS tag. It could be from Revolutions, or Dale's mods, orAfforess' stuff for RoM. Checked does not look like it is Afforess's stuff.
# Events.py
from BugEventManager import g_eventManager
def handler(event):
def handler_decorator(func):
g_eventManager.addEventHandler(event, func)
return func
return handler_decorator
# Handler.py
from Events import handler
@handler("BeginGameTurn")
def function_that_is_called_every_turn(*args):
# code here
@handler("BeginGameTurn")
def another_function_that_is_called_every_turn(*args):
# code here
# and so on
You could import Handler.py at the end of BugEventManager.BugEventManager.__init__(). That way g_eventManager should be already created when Handler.py is loaded. But that's maybe not the most robust construction.So if I load it from BugEventManager, I get a circular dependency.
Just to make sure I understand correctly, you want to avoid the following config file (untested), because you don't want to register every handler function in XML, and use decorators instead?Basically the idea is that you shouldn't have to think too hard about registering functions and delegating their calls between modules, and it's simplified to adding a decorator with the event type to be handled.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<mod id="Handler" module="Handler" [...] >
<event type="BeginGameTurn" function="function_that_is_called_every_turn"/>
<event type="BeginGameTurn" function="another_function_that_is_called_every_turn"/>
</mod>
Yes, my modmod is based on AND2.are those screenshots from AND
Here's my CIV4PlotLSystem file, maybe I miss something obvious.