Example #1
0
        public ComponentInfo(string fullTypeName, PublicMemberInfo[] memberInfos, string[] pools,
            bool isSingleEntity, string singleComponentPrefix, bool generateMethods, bool generateIndex)
        {
            _fullTypeName = fullTypeName;
            _memberInfos = memberInfos;
            _pools = pools;
            _isSingleEntity = isSingleEntity;
            _singleComponentPrefix = singleComponentPrefix;
            _generateMethods = generateMethods;
            _generateIndex = generateIndex;

            var nameSplit = fullTypeName.Split('.');
            _typeName = nameSplit[nameSplit.Length - 1];

            _isSingletonComponent = memberInfos.Length == 0;
        }
        static string memberNamesWithType(PublicMemberInfo[] memberInfos)
        {
            var typedArgs = memberInfos
                .Select(info => info.type.ToCompilableString() + " new" + info.name.UppercaseFirst())
                .ToArray();

            return string.Join(", ", typedArgs);
        }
        static string memberAssignments(PublicMemberInfo[] memberInfos)
        {
            const string format = "            component.{0} = {1};";
            var assignments = memberInfos.Select(info => {
                var newArg = "new" + info.name.UppercaseFirst();
                return string.Format(format, info.name, newArg);
            }).ToArray();

            return string.Join("\n", assignments);
        }
 static string memberNames(PublicMemberInfo[] memberInfos)
 {
     var args = memberInfos.Select(info => "new" + info.name.UppercaseFirst()).ToArray();
     return string.Join(", ", args);
 }
 public virtual void Parse(PublicMemberInfo memberInfo)
 {
 }