Ejemplo n.º 1
0
        public static Funk Load(DocumentParser file)
        {
            Funk funk = new Funk
            {
                Material      = file.ReadLine(),
                Mode          = file.ReadLine().ToEnum <FunkMode>(),
                MatrixModType = file.ReadLine().ToEnumWithDefault <FunkMatrixMode>(FunkMatrixMode.None)
            };

            if (funk.MatrixModType != FunkMatrixMode.None)
            {
                funk.MatrixModMode = file.ReadLine().ToEnum <GroovePathMode>();
            }

            switch (funk.MatrixModType)
            {
            case FunkMatrixMode.None:
                break;

            case FunkMatrixMode.roll:
                funk.RollPeriods = file.ReadVector2();
                break;

            case FunkMatrixMode.slither:
                funk.SlitherSpeed  = file.ReadVector2();
                funk.SlitherAmount = file.ReadVector2();
                break;

            case FunkMatrixMode.spin:
                funk.SpinPeriod = file.ReadSingle();
                break;

            default:
                Console.WriteLine(file.ToString());
                break;
            }

            funk.LightingMode = file.ReadLine().ToEnumWithDefault(GroovePathMode.None);
            if (funk.LightingMode != GroovePathMode.None)
            {
                Console.WriteLine(file.ToString());
            }

            funk.AnimationType = file.ReadLine().ToEnumWithDefault(FunkAnimationType.None);

            switch (funk.AnimationType)
            {
            case FunkAnimationType.None:
                break;

            case FunkAnimationType.frames:
                funk.Framerate = file.ReadEnum <FrameRate>();
                funk.FrameMode = file.ReadEnum <FrameType>();

                switch (funk.FrameMode)
                {
                case FrameType.texturebits:
                    funk.TextureBitMode = file.ReadEnum <TexturebitMode>();
                    break;

                case FrameType.continuous:
                    funk.FrameSpeed = file.ReadSingle();
                    break;
                }

                int frameCount = file.ReadInt();

                for (int i = 0; i < frameCount; i++)
                {
                    funk.Frames.Add(file.ReadLine());
                }
                break;

            default:
                throw new NotImplementedException($"flic not supported!");
            }

            return(funk);
        }
Ejemplo n.º 2
0
        public Groove(DocumentParser file)
            : this()
        {
            part = file.ReadLine();
            lollipopMode = file.ReadLine().ToEnumWithDefault<LollipopMode>(LollipopMode.NotALollipop);
            mode = file.ReadLine().ToEnum<GrooveMode>();
            pathType = file.ReadLine().ToEnumWithDefault<GroovePathNames>(GroovePathNames.None);
            if (pathType != GroovePathNames.None) { pathMode = file.ReadLine().ToEnum<GroovePathMode>(); }

            switch (pathType)
            {
                case GroovePathNames.None:
                    break;

                case GroovePathNames.straight:
                    pathCentre = file.ReadVector3();
                    pathPeriod = file.ReadSingle();
                    pathDelta = file.ReadVector3();
                    break;

                default:
                    Console.WriteLine();
                    break;
            }

            animationType = file.ReadLine().ToEnumWithDefault<GrooveAnimation>(GrooveAnimation.None);
            if (animationType != GrooveAnimation.None) { animationMode = file.ReadLine().ToEnum<GroovePathMode>(); }

            switch (animationType)
            {
                case GrooveAnimation.rock:
                    animationPeriod = file.ReadSingle();
                    animationCentre = file.ReadVector3();
                    animationAxis = file.ReadLine().ToEnum<GrooveAnimationAxis>();
                    rockMaxAngle = file.ReadSingle();
                    break;

                case GrooveAnimation.shear:
                    shearPeriod = file.ReadVector3();
                    animationCentre = file.ReadVector3();
                    shearMagnitude = file.ReadVector3();
                    break;

                case GrooveAnimation.spin:
                    animationPeriod = file.ReadSingle();
                    animationCentre = file.ReadVector3();
                    animationAxis = file.ReadLine().ToEnum<GrooveAnimationAxis>();
                    break;

                default:
                    Console.WriteLine(file.ToString());
                    break;
            }
        }
Ejemplo n.º 3
0
        public static Groove Load(DocumentParser file)
        {
            Groove groove = new Groove
            {
                Part         = file.ReadLine(),
                LollipopMode = file.ReadLine().ToEnumWithDefault(LollipopMode.NotALollipop),
                Mode         = file.ReadLine().ToEnum <GrooveMode>(),
                PathType     = file.ReadLine().ToEnumWithDefault(GroovePathNames.None)
            };

            if (groove.PathType != GroovePathNames.None)
            {
                groove.PathMode = file.ReadLine().ToEnum <GroovePathMode>();
            }

            switch (groove.PathType)
            {
            case GroovePathNames.None:
                break;

            case GroovePathNames.straight:
                groove.PathCentre = file.ReadVector3();
                groove.PathPeriod = file.ReadSingle();
                groove.PathDelta  = file.ReadVector3();
                break;

            default:
                Console.WriteLine();
                break;
            }

            groove.AnimationType = file.ReadLine().ToEnumWithDefault(GrooveAnimation.None);
            if (groove.AnimationType != GrooveAnimation.None)
            {
                groove.AnimationMode = file.ReadLine().ToEnum <GroovePathMode>();
            }

            switch (groove.AnimationType)
            {
            case GrooveAnimation.None:
                break;

            case GrooveAnimation.rock:
                groove.AnimationPeriod = file.ReadSingle();
                groove.AnimationCentre = file.ReadVector3();
                groove.AnimationAxis   = file.ReadLine().ToEnum <GrooveAnimationAxis>();
                groove.RockMaxAngle    = file.ReadSingle();
                break;

            case GrooveAnimation.shear:
                groove.ShearPeriod     = file.ReadVector3();
                groove.AnimationCentre = file.ReadVector3();
                groove.ShearMagnitude  = file.ReadVector3();
                break;

            case GrooveAnimation.spin:
                groove.AnimationPeriod = file.ReadSingle();
                groove.AnimationCentre = file.ReadVector3();
                groove.AnimationAxis   = file.ReadLine().ToEnum <GrooveAnimationAxis>();
                break;

            default:
                Console.WriteLine(file.ToString());
                break;
            }

            return(groove);
        }
Ejemplo n.º 4
0
        public Funk(DocumentParser file)
            : this()
        {
            material = file.ReadLine();
            mode = file.ReadLine().ToEnum<FunkMode>();
            matrixModType = file.ReadLine().ToEnum<FunkMatrixMode>();
            if (matrixModType != FunkMatrixMode.None) { matrixModMode = file.ReadLine().ToEnum<GroovePathMode>(); }

            switch (matrixModType)
            {
                case FunkMatrixMode.roll:
                    rollPeriods = file.ReadVector2();
                    break;

                case FunkMatrixMode.spin:
                    spinPeriod = file.ReadSingle();
                    break;

                default:
                    Console.WriteLine(file.ToString());
                    break;
            }

            lightingMode = file.ReadLine().ToEnumWithDefault<GroovePathMode>(GroovePathMode.None);
            if (lightingMode != GroovePathMode.None)
            {
                Console.WriteLine(file.ToString());
            }

            animationType = file.ReadLine().ToEnumWithDefault<FunkAnimationType>(FunkAnimationType.None);
            if (animationType != FunkAnimationType.None)
            {
                Console.WriteLine(file.ToString());
            }
        }