Exemple #1
0
 public IColorExpression Subtract(
     IScalarValue term1,
     params IScalarValue[] terms)
 => new ColorExpression(
     ListUtil.ReadonlyConcat(this.Terms,
                             this.ToColorValues(
                                 this.NegateTerms(term1, terms))));
 public IScalarTerm Divide(
     IScalarValue factor1,
     params IScalarValue[] factors)
 => new ScalarTerm(this.NumeratorFactors,
                   ListUtil.ReadonlyConcat(
                       this.DenominatorFactors,
                       ListUtil.ReadonlyFrom(factor1, factors)));
 public IScalarTerm Multiply(
     IScalarValue factor1,
     params IScalarValue[] factors)
 => new ScalarTerm(ListUtil.ReadonlyConcat(
                       this.NumeratorFactors,
                       ListUtil.ReadonlyFrom(factor1, factors)));
 public IScalarExpression Add(
     IScalarValue term1,
     params IScalarValue[] terms)
 => new ScalarExpression(ListUtil.ReadonlyConcat(this.Terms, terms));
Exemple #5
0
 public IColorTerm Multiply(
     IScalarValue factor1,
     params IScalarValue[] factors)
 => new ColorTerm(ListUtil.ReadonlyConcat(
                      this.NumeratorFactors,
                      this.ToColorValues(factor1, factors)));
Exemple #6
0
 public IColorExpression Add(
     IColorValue term1,
     params IColorValue[] terms)
 => new ColorExpression(ListUtil.ReadonlyConcat(this.Terms, terms));
        private void ExtractObject_(IFileHierarchyDirectory directory)
        {
            // TODO: What the heck is the difference between these directories?
            // Is there any besides the model type within?
            var bdlSubdir =
                directory.Subdirs.SingleOrDefault(subdir => subdir.Name == "bdl");
            var bdlmSubdir =
                directory.Subdirs.SingleOrDefault(subdir => subdir.Name == "bdlm");
            var bmdSubdir =
                directory.Subdirs.SingleOrDefault(subdir => subdir.Name == "bmd");
            var bmdcSubdir =
                directory.Subdirs.SingleOrDefault(subdir => subdir.Name == "bmdc");
            var bmdmSubdir =
                directory.Subdirs.SingleOrDefault(subdir => subdir.Name == "bmdm");

            var bmdOrBdlFiles = ListUtil.ReadonlyConcat(
                //bdlSubdir?.FilesWithExtension(".bdl").ToArray(),
                //bdlmSubdir?.FilesWithExtension(".bdl").ToArray(),
                bmdSubdir?.FilesWithExtension(".bmd").ToArray(),
                bmdcSubdir?.FilesWithExtension(".bmd").ToArray(),
                bmdmSubdir?.FilesWithExtension(".bmd").ToArray());

            var bckSubdir =
                directory.Subdirs.SingleOrDefault(
                    subdir => subdir.Name == "bck" || subdir.Name == "bcks");
            var bckFiles = bckSubdir?.FilesWithExtension(".bck").ToList();

            if (bmdOrBdlFiles.Count == 1 ||
                (bckFiles == null && bmdOrBdlFiles.Count > 0))
            {
                this.ExtractModels_(directory,
                                    bmdOrBdlFiles,
                                    bckFiles?
                                    .Select(file => file.Impl)
                                    .ToArray());
            }
            else if (bmdOrBdlFiles.Count > 0)
            {
                IOrganizeMethod organizeMethod;
                switch (directory.Name)
                {
                case "Sh": {
                        organizeMethod = new SuffixOrganizeMethod(1);
                        break;
                }

                case "Oq": {
                    organizeMethod = new NameMatchOrganizeMethod(directory.Name);
                    break;
                }

                case "Ylesr00": {
                    organizeMethod = new PrefixOrganizeMethod();
                    break;
                }

                default:
                    throw new NotImplementedException();
                }

                this.ExtractFilesByOrganizing_(directory,
                                               bmdOrBdlFiles.ToArray(),
                                               bckFiles,
                                               organizeMethod);
            }
        }