初次提交

This commit is contained in:
m0_75251201
2025-07-12 11:30:22 +08:00
commit 7700703099
1156 changed files with 21532 additions and 0 deletions

View File

@ -0,0 +1,13 @@
namespace Cosmobox.Def
{
public partial class Character : Define
{
public DrawingOrder
drawingOrder_down,
drawingOrder_up,
drawingOrder_left,
drawingOrder_right;
}
}

View File

@ -0,0 +1 @@
uid://criteyjl5dksn

View File

@ -0,0 +1,42 @@
using System.Xml.Linq;
namespace Cosmobox.Def
{
public class Define
{
public string defName;
[NeedTranslate]
public string label;
[NeedTranslate]
public string discription;
/// <summary>
/// 初始化方法,根据传入的 XML 元素 (<paramref name="xmlDef"/>) 进行处理。
/// </summary>
/// <param name="xmlDef">包含定义信息的 XML 元素。</param>
/// <returns>
/// 返回一个布尔值:
/// - 如果返回 <c>false</c>,表示按照默认方式处理(依次对 XML 进行变量名识别和赋值)。
/// - 如果返回 <c>true</c>,表示使用自定义方式处理,不进行额外的默认处理。
/// </returns>
/// <remarks>
/// <para>
/// 该方法的基类实现会自动识别并处理以下三个变量:
/// - <c>defName</c>
/// - <c>label</c>
/// - <c>description</c>
/// </para>
/// <para>
/// 如果需要覆盖默认行为,可以在派生类中重写此方法,并返回 <c>true</c>
/// 以指示框架跳过默认处理逻辑。
/// </para>
/// </remarks>
public virtual bool Init(XElement xmlDef)
{
defName = xmlDef.Element("defName")?.Value;
label = xmlDef.Element("label")?.Value;
discription = xmlDef.Element("discription")?.Value;
return false;
}
}
}

View File

@ -0,0 +1 @@
uid://btgw3kqfk2i6y

View File

@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.Xml.Linq;
namespace Cosmobox.Def
{
public partial class DrawNode : Define
{
public string NodeName { get; set; }
public List<DrawNode> Children { get; set; } = [];
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
NodeName = xmlDef.Element("NodeName")?.Value;
foreach (var childNode in xmlDef.Elements("DrawNode"))
{
DrawNode child = new DrawNode();
child.Init(childNode);
Children.Add(child);
}
return true;
}
}
}

View File

@ -0,0 +1 @@
uid://by1lt06g8xkiy

View File

@ -0,0 +1,23 @@
using System.Collections.Generic;
using System.Xml.Linq;
namespace Cosmobox.Def
{
public class DrawingOrder : Define
{
public List<DrawNode> DrawNodes { get; set; } = new List<DrawNode>();
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
foreach (var node in xmlDef.Elements("DrawNodes"))
{
DrawNode drawNode = new DrawNode();
drawNode.Init(node);
DrawNodes.Add(drawNode);
}
return true;
}
}
}

View File

@ -0,0 +1 @@
uid://coat5tts3smlo