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

            AddRecline(recline);
            return(recline);
        }
示例#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);
        }
示例#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);
        }
示例#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));
        }
示例#6
0
 public void AddRecline(Recline recline)
 {
     reclineByFilename[recline.Name] = recline;
     Reclines.Add(recline);
 }