Пример #1
0
            public ActiveEvent(EventData d)
            {
                data = d;
                type = (EventData.Type)Enum.Parse(typeof(EventData.Type), data.type);

                var tokens = EventParser.tokenize(data.conditional);

                conditionalRoot = EventParser.parse(tokens);
            }
Пример #2
0
        public void updateEnvironment(List <EventData.Variable> vs)
        {
            // Just parse enviroment expressions on the fly.
            // Only one event can occur every turn, so performance will be OK.
            foreach (var v in vs)
            {
                var tokens = EventParser.tokenize(v.value);
                var syntax = EventParser.parse(tokens);

                string res = EventRuntime.evaluateAny(syntax, this);
                writeEnvironment(v.key, res, v.local);
            }
        }