Esempio n. 1
0
        CodeGenFile generateComponentClass(ComponentData data)
        {
            var fullComponentName = data.GetTypeName().RemoveDots();

            return(new CodeGenFile(
                       "Components" + Path.DirectorySeparatorChar + fullComponentName + ".cs",
                       COMPONENT_TEMPLATE
                       .Replace("${FullComponentName}", fullComponentName)
                       .Replace("${Type}", data.GetObjectType()),
                       GetType().FullName
                       ));
        }
Esempio n. 2
0
        CodeGenFile generateComponentClass(ComponentData data)
        {
            var fullComponentName = data.GetFullTypeName().RemoveDots();
            var contexts          = string.Join(", ", data.GetContextNames());
            var unique            = data.IsUnique() ? "[Entitas.CodeGeneration.Attributes.UniqueAttribute]" : string.Empty;

            if (!string.IsNullOrEmpty(contexts))
            {
                contexts = "[" + contexts + "]";
            }

            return(new CodeGenFile(
                       "Components" + Path.DirectorySeparatorChar + fullComponentName + ".cs",
                       COMPONENT_TEMPLATE
                       .Replace("${FullComponentName}", fullComponentName)
                       .Replace("${Type}", data.GetObjectType())
                       .Replace("${Contexts}", contexts)
                       .Replace("${Unique}", unique),
                       GetType().FullName
                       ));
        }