Reorganize project structure

This commit is contained in:
Stone_Red
2026-06-19 00:56:46 +02:00
parent 6f58eefb66
commit 95d88f1a8d
84 changed files with 267 additions and 186 deletions
@@ -0,0 +1,34 @@
using RemSox.Shared.UI.GUI.Rendering;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Circle() : Shape("Circle")
{
public int Radius
{
get;
set => SetProperty(nameof(Radius), ref field, value);
}
public bool IsFilled
{
get;
set => SetProperty(nameof(IsFilled), ref field, value);
} = true;
public override IEnumerable<RenderCommand> ToPrimitives(int windowId)
{
yield return new RenderCommand
{
WindowId = windowId,
ElementId = PrimitiveId(0),
Type = IsFilled ? RenderCommandType.DrawFilledCircle : RenderCommandType.DrawCircle,
Position = Position,
Properties = new Dictionary<string, object?>
{
["Color"] = Color,
["Radius"] = Radius,
}
};
}
}
@@ -0,0 +1,30 @@
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Line() : Shape("Line")
{
public Point EndPosition
{
get;
set => SetProperty(nameof(EndPosition), ref field, value);
}
public override IEnumerable<RenderCommand> ToPrimitives(int windowId)
{
yield return new RenderCommand
{
WindowId = windowId,
ElementId = PrimitiveId(0),
Type = RenderCommandType.DrawLine,
Position = Position,
Properties = new Dictionary<string, object?>
{
["Color"] = Color,
["EndPosition"] = EndPosition,
}
};
}
}
@@ -0,0 +1,21 @@
using RemSox.Shared.UI.GUI.Rendering;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Pixel() : Shape("Pixel")
{
public override IEnumerable<RenderCommand> ToPrimitives(int windowId)
{
yield return new RenderCommand
{
WindowId = windowId,
ElementId = PrimitiveId(0),
Type = RenderCommandType.DrawPoint,
Position = Position,
Properties = new Dictionary<string, object?>
{
["Color"] = Color,
}
};
}
}
@@ -0,0 +1,36 @@
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Rectangle() : Shape("Rectangle")
{
public Size Size
{
get;
set => SetProperty(nameof(Size), ref field, value);
}
public bool IsFilled
{
get;
set => SetProperty(nameof(IsFilled), ref field, value);
} = true;
public override IEnumerable<RenderCommand> ToPrimitives(int windowId)
{
yield return new RenderCommand
{
WindowId = windowId,
ElementId = PrimitiveId(0),
Type = IsFilled ? RenderCommandType.DrawFilledRect : RenderCommandType.DrawRectBorder,
Position = Position,
Properties = new Dictionary<string, object?>
{
["Color"] = Color,
["Size"] = Size,
}
};
}
}
@@ -0,0 +1,50 @@
using RemSox.Shared.UI.GUI.Rendering;
using System.Drawing;
namespace RemSox.Kernel.UI.GUI.UIEelements.Shapes;
public class Text() : UIElement("Text")
{
public string Content
{
get;
set => SetProperty(nameof(Content), ref field, value);
} = string.Empty;
public Color Color
{
get;
set => SetProperty(nameof(Color), ref field, value);
} = Color.White;
public int FontSize
{
get;
set => SetProperty(nameof(FontSize), ref field, value);
} = 12;
public int MaxWidth
{
get;
set => SetProperty(nameof(MaxWidth), ref field, value);
} = int.MaxValue;
public override IEnumerable<RenderCommand> ToPrimitives(int windowId)
{
yield return new RenderCommand
{
WindowId = windowId,
ElementId = PrimitiveId(0),
Type = RenderCommandType.DrawText,
Position = Position,
Properties = new Dictionary<string, object?>
{
["Color"] = Color,
["Content"] = Content,
["FontSize"] = FontSize,
["MaxWidth"] = MaxWidth,
}
};
}
}