예제 #1
0
        public Rule(Action onRuleChanged = null)
        {
            OnRuleChanged = onRuleChanged;

            SourceBuildings = new PropertyEnumValue <SourceBuildingTypes>("Source", RuleChanged, SourceBuildingTypes.All);
            TargetBuildings = new PropertyEnumValue <TargetBuildingTypes>("Target", RuleChanged, TargetBuildingTypes.All);
            UseSize         = new PropertyBoolValue("UseSize", RuleChanged, false);
            MaxLength       = new PropertyStructValue <int>("MaxLength", RuleChanged, 4);
            MaxWidth        = new PropertyStructValue <int>("MaxWidth", RuleChanged, 4);
        }
예제 #2
0
        private LineAlignmentPropertyPanel AddAlignmentProperty(PropertyEnumValue <Alignment> property, string label)
        {
            var alignment = ComponentPool.Get <LineAlignmentPropertyPanel>(LineProperties, "LineAlignment");

            alignment.Text = label;
            alignment.Init();
            alignment.SelectedObject         = property;
            alignment.OnSelectObjectChanged += (value) => property.Value = value;

            return(alignment);
        }
예제 #3
0
        public MarkupStopLine(Markup markup, MarkupPointPair pointPair, StopLineStyle style = null, Alignment firstAlignment = Alignment.Centre, Alignment secondAlignment = Alignment.Centre) : base(markup, pointPair, false)
        {
            RawStartAlignment = new PropertyEnumValue <Alignment>("AL", AlignmentChanged, firstAlignment);
            RawEndAlignment   = new PropertyEnumValue <Alignment>("AR", AlignmentChanged, secondAlignment);

            style ??= SingletonManager <StyleTemplateManager> .Instance.GetDefault <StopLineStyle>(Style.StyleType.StopLineSolid);

            var rule = new MarkupLineRawRule <StopLineStyle>(this, style, new EnterPointEdge(Start), new EnterPointEdge(End));

            SetRule(rule);

            Update(true);
            RecalculateStyleData();
        }
예제 #4
0
        public MarkupRegularLine(Markup markup, MarkupPointPair pointPair, RegularLineStyle style = null, Alignment alignment = Alignment.Centre, bool update = true) : base(markup, pointPair, false)
        {
            RawAlignment = new PropertyEnumValue <Alignment>("A", AlignmentChanged, alignment);

            if (update)
            {
                Update(true);
            }

            if (style != null)
            {
                AddRule(style, false, false);
                RecalculateStyleData();
            }
        }
 public PropLineStyle(PropInfo prop, int probability, ColorOptionEnum colorOption, Color32 color, float step, Vector2 angle, float shift, Vector2 scale, float elevation, float offsetBefore, float offsetAfter) : base(prop, probability, step, angle, shift, scale, elevation, offsetBefore, offsetAfter)
 {
     Color.Value = color;
     ColorOption = new PropertyEnumValue <ColorOptionEnum>("CO", StyleChanged, colorOption);
 }
예제 #6
0
 public DoubleSolidLineStyle(Color32 color, float width, float offset) : base(color, width)
 {
     Offset    = GetOffsetProperty(offset);
     Alignment = GetAlignmentProperty(Manager.Alignment.Centre);
 }
예제 #7
0
 public DoubleDashedLineStyle(Color32 color, float width, float dashLength, float spaceLength, float offset) : base(color, width, dashLength, spaceLength)
 {
     Offset    = GetOffsetProperty(offset);
     Alignment = GetAlignmentProperty(Manager.Alignment.Centre);
 }