Esempio n. 1
0
        /// <summary>
        /// クローンメソッド
        /// </summary>
        /// <returns></returns>
        public object Clone()
        {
            var ret = new BezierRatioMaker
            {
                Analyzer = (BezierAnalyzer)Analyzer.Clone()
            };

            return(ret);
        }
Esempio n. 2
0
        private static void ReadXMLRatioMakers(XmlReader reader, EffectStateRatioSet set)
        {
            while (reader.Read())
            {
                if (reader.Name == "RatioMaker")
                {
                    RatioType type = RatioType.X;
                    switch (reader.GetAttribute("Type"))
                    {
                    case "X":
                        type = RatioType.X;
                        break;

                    case "Y":
                        type = RatioType.Y;
                        break;

                    case "Alpha":
                        type = RatioType.Alpha;
                        break;

                    case "Rotation":
                        type = RatioType.Rotation;
                        break;

                    case "ScaleX":
                        type = RatioType.ScaleX;
                        break;

                    case "ScaleY":
                        type = RatioType.ScaleY;
                        break;

                    case "BezierPosition":
                        type = RatioType.BezierPosition;
                        break;
                    }
                    IRatioMaker maker = null;
                    switch (reader.GetAttribute("MakerType"))
                    {
                    case "LinearRatioMaker":
                        maker = new LinearRatioMaker();
                        break;

                    case "ConstantRatioMaker":
                        maker = new ConstantRatioMaker();
                        break;

                    case "BezierRatioMaker":
                        var p1 = BezierControlPoint.Deserialize(reader.GetAttribute("P1"));
                        var p2 = BezierControlPoint.Deserialize(reader.GetAttribute("P2"));
                        maker = new BezierRatioMaker(p1, p2);
                        break;
                    }
                    maker.Set = set;
                    set[type] = maker;
                }
            }
            reader.Close();
            set.SetDefaultToNullMaker();
        }