Esempio n. 1
0
        public SettingsToken(SettingsTokens t, string d)
        {
            Type = t;

            switch (Type)
            {
            case SettingsTokens.name: Data = GetName(d); break;

            case SettingsTokens.game: Data = GetName(d); break;

            case SettingsTokens.build: Data = GetBuildData(d); break;

            case SettingsTokens.format: Data = GetOutputTypes(d); break;

            case SettingsTokens.start: goto case SettingsTokens.loop;

            case SettingsTokens.end: goto case SettingsTokens.loop;

            case SettingsTokens.size: goto case SettingsTokens.loop;

            case SettingsTokens.loop: Data = GetNumericalData(d); break;

            case SettingsTokens.iterator: goto case SettingsTokens.loop;

            case SettingsTokens.inc: goto case SettingsTokens.loop;

            default:
                Data = null; break;
            }
        }
Esempio n. 2
0
        private static IList Get(List <SettingsToken> settings, SettingsTokens t)
        {
            var a = settings.SingleOrDefault(x => x.Type == t);

            if (a == null)
            {
                switch (t)
                {
                case SettingsTokens.format: return(new List <FormatTypesEnum>()
                    {
                        FormatTypesEnum.tsv
                    });

                case SettingsTokens.iterator: return(new List <long>()
                    {
                        0L
                    });

                case SettingsTokens.inc: return(new List <long>()
                    {
                        1L
                    });

                default: return(null);
                }
            }
            return(a.Data);
        }
Esempio n. 3
0
        private static object GetSingle(List <SettingsToken> settings, SettingsTokens type, int i)
        {
            IList  list = Get(settings, type);
            object result;
            int    maxIndex = list.Count - 1;

            i = (i > maxIndex) ? maxIndex : i;

            result = list[i];
            return(result);
        }
Esempio n. 4
0
        private static IList Get(List <SettingsToken> settings, SettingsTokens t)
        {
            var a = settings.SingleOrDefault(x => x.Type == t);

            if (a == null)
            {
                return(t switch
                {
                    SettingsTokens.format => new List <FormatTypesEnum>()
                    {
                        FormatTypesEnum.tsv
                    },
                    SettingsTokens.iterator => new List <long>()
                    {
                        0L
                    },
                    SettingsTokens.inc => new List <long>()
                    {
                        1L
                    },
                    _ => null,
                });