Ejemplo n.º 1
0
        } = string.Empty;                               // for work in person's posture

        public static Info_Scene GenerateFromString(string item)
        {
            Info_Scene Rez = new Info_Scene();

            Rez.LoadFromString(item);
            return(Rez);
        }
Ejemplo n.º 2
0
        public static Info_Scene GenerateCopy(Info_Scene item)
        {
            Info_Scene Rez = (Info_Scene)item.MemberwiseClone();

            //Rez.Align = item.Align;
            //Rez.Description = item.Description;
            //Rez.F = item.F;
            //Rez.File = item.File;
            //Rez.Group = item.Group;
            //Rez.ID = item.ID;
            //Rez.Kind = item.Kind;
            //Rez.LoopCount = item.LoopCount;
            //Rez.LoopMode = item.LoopMode;
            //Rez. = item.Align;
            //Rez.Align = item.Align;
            //Rez.Align = item.Align;
            return(Rez);
        }
Ejemplo n.º 3
0
        public void LoadFrom(List <string> clipsinstr)
        {
            bool          isMetadata        = false;
            bool          isDescription     = false;
            bool          isRawData         = false;
            List <string> lines             = new List <string>();
            List <string> description_lines = new List <string>();
            List <string> rawdata_lines     = new List <string>();

            foreach (var line in clipsinstr)
            {
                if (line.StartsWith("****METADATA START****"))
                {
                    isMetadata = true;
                    continue;
                }
                else if (line.StartsWith("****METADATA END****"))
                {
                    isMetadata = false;
                    continue;
                }

                if (line.StartsWith("NAME:"))
                {
                    this.Name = line.Replace("NAME:", string.Empty);
                }
                else if (line.StartsWith("ID:"))
                {
                    this.Id = line.Replace("ID:", string.Empty).Trim();
                    if (string.IsNullOrEmpty(this.Id) || this.Id.Contains("ID"))
                    {
                        this.Id = Guid.NewGuid().ToString();
                    }
                }
                else if (line.StartsWith("FILENAME:"))
                {
                    this.FileName = line.Replace("FILENAME:", string.Empty);
                }
                else if (line.StartsWith("LOCATION:"))
                {
                    this.Location = line.Replace("LOCATION:", string.Empty);
                }
                else if (line.StartsWith("FEMALE:"))
                {
                    this.Female = line.Replace("FEMALE:", string.Empty);
                }
                else if (line.StartsWith("FGARMENT:"))
                {
                    this.Fgarment = line.Replace("FGARMENT:", string.Empty);
                }
                else if (line.StartsWith("MALE:"))
                {
                    this.Male = line.Replace("MALE:", string.Empty);
                }
                else if (line.StartsWith("MGARMENT:"))
                {
                    this.Mgarment = line.Replace("MGARMENT:", string.Empty);
                }
                else if (line.StartsWith("ACTION:"))
                {
                    this.Action = line.Replace("ACTION:", string.Empty);
                }
                else if (line.StartsWith("KIND:"))
                {
                    this.Kind = line.Replace("KIND:", string.Empty);
                }
                else if (line.StartsWith("CATEGORY:"))
                {
                    this.Category = line.Replace("CATEGORY:", string.Empty);
                }
                else if (line.StartsWith("VARIANT:"))
                {
                    this.Variant = line.Replace("VARIANT:", string.Empty);
                }
                else if (line.StartsWith("STOPWORDS:"))
                {
                    this.StopWords = line.Replace("STOPWORDS:", string.Empty);
                }
                else if (line.StartsWith("DESCRIPTION:"))
                {
                    isDescription = true;
                    isRawData     = false;
                }
                else if (line.StartsWith("RAWPARAMETERS:"))
                {
                    isDescription = false;
                    isRawData     = true;
                }
                else
                {
                    if (isMetadata)
                    {
                        if (isDescription)
                        {
                            description_lines.Add(line);
                            //this.Description = $"{this.Description}{Environment.NewLine}{line}";
                        }
                        else if (isRawData)
                        {
                            rawdata_lines.Add(line);
                            //this.RawParameters = $"{this.RawParameters}{Environment.NewLine}{line}";
                        }
                    }
                    else
                    {
                        lines.Add(line);
                    }
                }
            }
            this.Description   = string.Join(Environment.NewLine, description_lines.ToArray());
            this.RawParameters = string.Join(Environment.NewLine, rawdata_lines.ToArray());
            this.SceneInfos.Clear();
            foreach (var line in lines)
            {
                this.SceneInfos.Add(Info_Scene.GenerateFromString(line));
            }
            AssignRawParameters();
        }