implement

This commit is contained in:
2026-02-08 21:32:24 +01:00
parent 90c127ddb3
commit 9d95bb5cc3
15 changed files with 313 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
using System.Drawing;
using AipsCore.Domain.Models.Shape.Enums;
using AipsCore.Domain.Models.Shape.ValueObjects;
namespace AipsCore.Domain.Models.Shape.Sub.Arrow;
public class Arrow : Shape
{
public Position EndPosition { get; private set; }
public Thickness Thickness { get; private set; }
public Arrow(ShapeId id, Position position, Color color, Position endPosition, Thickness thickness) : base(id, position, color)
{
EndPosition = endPosition;
Thickness = thickness;
}
public override ShapeTypeEnum ShapeType => ShapeTypeEnum.Arrow;
}

View File

@@ -0,0 +1,19 @@
using System.Drawing;
using AipsCore.Domain.Models.Shape.Enums;
using AipsCore.Domain.Models.Shape.ValueObjects;
namespace AipsCore.Domain.Models.Shape.Sub.Line;
public class Line : Shape
{
public Position EndPosition { get; private set; }
public Thickness Thickness { get; private set; }
public Line(ShapeId id, Position position, Color color, Position endPosition, Thickness thickness) : base(id, position, color)
{
EndPosition = endPosition;
Thickness = thickness;
}
public override ShapeTypeEnum ShapeType => ShapeTypeEnum.Line;
}

View File

@@ -0,0 +1,22 @@
using System.Drawing;
using AipsCore.Domain.Models.Shape.Enums;
using AipsCore.Domain.Models.Shape.ValueObjects;
namespace AipsCore.Domain.Models.Shape.Sub.Rectangle;
public class Rectangle : Shape
{
public override ShapeTypeEnum ShapeType => ShapeTypeEnum.Rectangle;
public Position EndPosition { get; }
public Thickness BorderThickness { get; }
public Rectangle(ShapeId id, Position position, Color color, Position endPosition, Thickness borderThickness)
: base(id, position, color)
{
EndPosition = endPosition;
BorderThickness = borderThickness;
}
}

View File

@@ -0,0 +1,22 @@
using System.Drawing;
using AipsCore.Domain.Models.Shape.Enums;
using AipsCore.Domain.Models.Shape.Sub.TextShape.ValueObjects;
using AipsCore.Domain.Models.Shape.ValueObjects;
namespace AipsCore.Domain.Models.Shape.Sub.TextShape;
public class TextShape : Shape
{
public TextShapeValue TextShapeValue { get; private set; }
public TextShapeSize TextShapeSize { get; private set; }
public TextShape(ShapeId id, Position position, Color color, TextShapeValue textShapeValue, TextShapeSize textShapeSize)
: base(id, position, color)
{
TextShapeValue = textShapeValue;
TextShapeSize = textShapeSize;
}
public override ShapeTypeEnum ShapeType => ShapeTypeEnum.Text;
}

View File

@@ -0,0 +1,27 @@
using AipsCore.Domain.Abstract.Rule;
using AipsCore.Domain.Abstract.ValueObject;
using AipsCore.Domain.Common.Validation.Rules;
namespace AipsCore.Domain.Models.Shape.Sub.TextShape.ValueObjects;
public record TextShapeSize : AbstractValueObject
{
public const int MaxTextShapeSize = 72;
public const int MinTextShapeSize = 8;
public int Size { get; }
public TextShapeSize(int size)
{
Size = size;
}
protected override ICollection<IRule> GetValidationRules()
{
return
[
new MaxValueRule<int>(Size, MaxTextShapeSize),
new MinValueRule<int>(Size, MinTextShapeSize)
];
}
}

View File

@@ -0,0 +1,19 @@
using AipsCore.Domain.Abstract.Rule;
using AipsCore.Domain.Abstract.ValueObject;
namespace AipsCore.Domain.Models.Shape.Sub.TextShape.ValueObjects;
public record TextShapeValue: AbstractValueObject
{
public string Text { get; }
public TextShapeValue(string text)
{
Text = text;
}
protected override ICollection<IRule> GetValidationRules()
{
return [];
}
}