Exemplo n.º 1
0
        private EventElement CreateEventGUI(VisualElement root, EventRow @event)
        {
            var eventElem = new EventElement {
                text = @event.Id
            };

            var stagesContainer = new StagesContainer();

            eventElem.Content.Add(new InvokeTypeElement {
                value = @event.InvokeType.ToKeyword()
            });
            eventElem.Content.Add(stagesContainer);

            foreach (var stage in @event.Stages)
            {
                var stageContainer = new StageContainer();
                stagesContainer.Add(stageContainer);

                stageContainer.Add(new StageElement {
                    value = $"{stage.Index}"
                });

                if (stage.MaxConstraint >= 0)
                {
                    stageContainer.Add(new StageElement {
                        value = $"<{stage.MaxConstraint}>"
                    });
                }

                var commandContainer = new CommandContainer();
                stageContainer.Add(commandContainer);

                foreach (var command in stage.Commands)
                {
                    commandContainer.Add(new CommandElement {
                        value = command.Id
                    });
                }
            }

            root.Add(eventElem);
            return(eventElem);
        }
Exemplo n.º 2
0
        private void ParseElement(string name)
        {
            var el = new StageElement(name);

            if (_curRoot != null)
            {
                _curRoot.Add(el);
            }

            _curRoot = el;

            for (; _idx < _length; _idx++)
            {
                var c = _s[_idx];
                switch (c)
                {
                case ',':
                case ' ':
                case '\t':
                case '\n':
                case '\r':
                case '\f':
                {
                    /* Skip white space and item separator */
                    break;
                }

                case '}':
                {
                    _curRoot = _curRoot.parent ?? _curRoot;
                    return;
                }

                default:
                {
                    ParseItem();
                    break;
                }
                }
            }
        }