(client) feat:新增人物角色的部分定义(Character,DrawingOrder,DrawNode)

This commit is contained in:
m0_75251201
2025-07-13 19:23:45 +08:00
committed by TheRedApricot
parent bc00da1e5f
commit e07e66c451
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,48 @@
using System.Collections.Generic;
using System.Xml.Linq;
namespace Data
{
public class Character : Define
{
public DrawingOrder
drawingOrder_down,
drawingOrder_up,
drawingOrder_left,
drawingOrder_right;
}
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;
}
}
public partial class DrawNode : Define
{
public string NodeName { get; set; }
public List<DrawNode> Children { get; set; } = new();
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
NodeName = xmlDef.Attribute("name")?.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,3 @@
fileFormatVersion: 2
guid: e277dc789917427a81ab775cb5e74107
timeCreated: 1752403551