Add CharacterDefine #21

Merged
TheRedApricot merged 8 commits from zzdxxz/Gen_Hack-and-Slash-Roguelite-zzdxxz:main into main 2025-07-13 21:16:01 +08:00
5 changed files with 51 additions and 43 deletions
Showing only changes of commit 4abf6c90f0 - Show all commits

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