예제 #1
0
        protected static UEStructProperty ReadStructValue(string type, BinaryReader reader)
        {
            UEStructProperty result;

            switch (type)
            {
            case "DateTime":
                result = new UEDateTimeStructProperty(reader);
                break;

            case "Guid":
                result = new UEGuidStructProperty(reader);
                break;

            case "Vector":
            case "Rotator":
                result = new UEVectorStructProperty(reader);
                break;

            case "Rotation":
                result = new UEVectorStructProperty(reader);
                break;

            case "LinearColor":
                result = new UELinearColorStructProperty(reader);
                break;

            case "Quat":
                // TODO: Implement Quat parser, GUID parser as placeholder, results are currently invalid
                result = new UEGuidStructProperty(reader);
                break;

            default:
                var tmp = new UEGenericStructProperty();
                while (Read(reader) is UEProperty prop)
                {
                    tmp.Properties.Add(prop);
                    if (prop is UENoneProperty)
                    {
                        break;
                    }
                }
                result = tmp;
                break;
            }
            result.Type = type;
            return(result);
        }
예제 #2
0
        protected static UEStructProperty ReadStructValue(string type, BinaryReader reader)
        {
            UEStructProperty result;

            switch (type)
            {
            case "DateTime":
                result = new UEDateTimeStructProperty(reader);
                break;

            case "Guid":
                result = new UEGuidStructProperty(reader);
                break;

            case "Vector":
            case "Rotator":
                result = new UEVectorStructProperty(reader);
                break;

            case "LinearColor":
                result = new UELinearColorStructProperty(reader);
                break;

            case "Quat":
                result = new UEQuatStructProperty(reader);
                break;

            default:
                var tmp = new UEGenericStructProperty();
                while (Read(reader) is { } prop)
                {
                    tmp.Properties.Add(prop);
                    if (prop is UENoneProperty)
                    {
                        break;
                    }
                }
                result = tmp;
                break;
            }
            result.Type = type;
            return(result);
        }
예제 #3
0
        protected static UEStructProperty ReadStructValue(string type, BinaryReader reader, long valueLength)
        {
            UEStructProperty result;

            switch (type)
            {
            case "DateTime":
                result = new UEDateTimeStructProperty(reader);
                break;

            case "Guid":
                result = new UEGuidStructProperty(reader);
                break;

            case "Vector":
            case "Rotator":
                result = new UEVectorStructProperty(reader);
                break;

            case "LinearColor":
                result = new UELinearColorStructProperty(reader);
                break;

            /*case "Transform":
             *  result = new UETransformStructProperty(reader);
             *  break;*/
            case "Quat":
                result = new UEQuaternionStructProperty(reader);
                break;

            default:
                result = new UEGenericStructProperty(reader);
                break;
            }
            result.StructType  = type;
            result.ValueLength = valueLength;
            return(result);
        }