mirror of
https://github.com/DCFApixels/DragonECS.git
synced 2025-11-13 00:55:55 +08:00
update MetaGroup
This commit is contained in:
parent
c73d660f13
commit
fd5d1ec06a
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace DCFApixels.DragonECS
|
||||
{
|
||||
@ -7,10 +8,17 @@ namespace DCFApixels.DragonECS
|
||||
public sealed class MetaGroupAttribute : EcsMetaAttribute
|
||||
{
|
||||
public readonly MetaGroupRef Data;
|
||||
|
||||
[Obsolete("With empty parameters, this attribute makes no sense.")]
|
||||
public MetaGroupAttribute() { }
|
||||
public MetaGroupAttribute(string name)
|
||||
{
|
||||
Data = new MetaGroupRef(name);
|
||||
}
|
||||
public MetaGroupAttribute(params string[] path)
|
||||
{
|
||||
Data = new MetaGroupRef(string.Join('/', path));
|
||||
}
|
||||
}
|
||||
public class MetaGroupRef
|
||||
{
|
||||
@ -18,6 +26,7 @@ namespace DCFApixels.DragonECS
|
||||
|
||||
public readonly string Name;
|
||||
private string[] path = null;
|
||||
private static string pattern = @"Module(?=/)";
|
||||
public IReadOnlyCollection<string> Splited
|
||||
{
|
||||
get
|
||||
@ -41,7 +50,7 @@ namespace DCFApixels.DragonECS
|
||||
{
|
||||
name += '/';
|
||||
}
|
||||
Name = name;
|
||||
Name = Regex.Replace(name, pattern, ""); ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user