Esempio n. 1
0
 private void SetRecline(Recline recline)
 {
     Recline = recline;
     OnUpdateZonesRequested();
     ProjectLineChanged();
     ProjectLinePointsChanged();
 }
Esempio n. 2
0
        private Recline CreateUnknownRecline(string filename)
        {
            var recline = new Recline(this, filename);

            AddRecline(recline);
            return(recline);
        }
Esempio n. 3
0
        public static ProjectLine CreateNewFromRecline(Recline recline)
        {
            var projectLine = new ProjectLine()
            {
                RestPoints      = new List <int>(),
                VowelPoints     = new List <int>(),
                ConsonantPoints = new List <int>(),
                Recline         = recline
            };

            return(projectLine);
        }
Esempio n. 4
0
        public static ProjectLine Read(Recline recline, string pds, string pvs, string pcs)
        {
            var projectLine = new ProjectLine();

            projectLine.SetRecline(recline);
            if (pds.Length > 0)
            {
                projectLine.RestPoints = pds.Split(' ').Select(n => int.Parse(n)).ToList();
            }
            if (pvs.Length > 0)
            {
                projectLine.VowelPoints = pvs.Split(' ').Select(n => int.Parse(n)).ToList();
            }
            if (pcs.Length > 0)
            {
                projectLine.ConsonantPoints = pcs.Split(' ').Select(n => int.Parse(n)).ToList();
            }

            return(projectLine);
        }
Esempio n. 5
0
        public int AddPoint(int position, PhonemeType type)
        {
            var points      = PointsOfType(type);
            var phonemes    = Recline.PhonemesOfType(type);
            var neededCount = phonemes.Count * 2;

            if (points.Count >= neededCount)
            {
                return(-1);
            }
            var realPhonemes = PointsOfType(type, virtuals: false);

            if (realPhonemes.Contains(position))
            {
                return(-1);
            }
            realPhonemes.Add(position);
            realPhonemes.Sort();
            UpdateZones();
            ProjectLinePointsChanged();
            return(realPhonemes.IndexOf(position));
        }
Esempio n. 6
0
 public void AddRecline(Recline recline)
 {
     reclineByFilename[recline.Name] = recline;
     Reclines.Add(recline);
 }