protected void ReadExpressionInput(BinaryReader reader, bool includeHeader, long leng)
 {
     OutputIndex = reader.ReadInt32();
     InputName   = new NamePropertyData(Name, Asset);
     InputName.Read(reader, false, 0);
     reader.ReadBytes(20); // always 0s
     ExpressionName = new NamePropertyData(Name, Asset);
     ExpressionName.Read(reader, false, 0);
     return;
 }
Beispiel #2
0
        public static PropertyData TypeToClass(string type, string name, AssetReader asset, BinaryReader reader = null, long leng = 0, bool includeHeader = true)
        {
            //Debug.WriteLine(type);
            PropertyData data;

            switch (type)
            {
            case "BoolProperty":
                data = new BoolPropertyData(name, asset);
                break;

            case "Int8Property":
                data = new Int8PropertyData(name, asset);
                break;

            case "Int16Property":
                data = new Int16PropertyData(name, asset);
                break;

            case "IntProperty":
                data = new IntPropertyData(name, asset);
                break;

            case "Int64Property":
                data = new Int64PropertyData(name, asset);
                break;

            case "UInt16Property":
                data = new UInt16PropertyData(name, asset);
                break;

            case "UInt32Property":
                data = new UInt32PropertyData(name, asset);
                break;

            case "UInt64Property":
                data = new UInt64PropertyData(name, asset);
                break;

            case "FloatProperty":
                data = new FloatPropertyData(name, asset);
                break;

            case "TextProperty":
                data = new TextPropertyData(name, asset);
                break;

            case "StrProperty":
                data = new StrPropertyData(name, asset);
                break;

            case "ObjectProperty":
                data = new ObjectPropertyData(name, asset);
                break;

            case "EnumProperty":
                data = new EnumPropertyData(name, asset);
                break;

            case "ByteProperty":
                data = new BytePropertyData(name, asset);
                break;

            case "NameProperty":
                data = new NamePropertyData(name, asset);
                break;

            case "ArrayProperty":
                data = new ArrayPropertyData(name, asset);
                break;

            case "MapProperty":
                data = new MapPropertyData(name, asset);
                break;

            case "StructProperty":
                data = new StructPropertyData(name, asset);
                break;

            case "Guid":
                data = new GuidPropertyData(name, asset);
                break;

            case "LinearColor":
                data = new LinearColorPropertyData(name, asset);
                break;

            case "Color":
                data = new ColorPropertyData(name, asset);
                break;

            case "Vector":
                data = new VectorPropertyData(name, asset);
                break;

            case "Vector2D":
                data = new Vector2DPropertyData(name, asset);
                break;

            case "Box":
                data = new BoxPropertyData(name, asset);
                break;

            case "IntPoint":
                data = new IntPointPropertyData(name, asset);
                break;

            case "DateTime":
                data = new DateTimePropertyData(name, asset);
                break;

            case "Timespan":
                data = new TimespanPropertyData(name, asset);
                break;

            case "Rotator":
                data = new RotatorPropertyData(name, asset);
                break;

            case "Quat":
                data = new QuatPropertyData(name, asset);
                break;

            case "Vector4":
                data = new Vector4PropertyData(name, asset);
                break;

            case "SoftObjectProperty":
                data = new SoftObjectPropertyData(name, asset);
                break;

            case "MulticastDelegateProperty":
                data = new MulticastDelegatePropertyData(name, asset);
                break;

            default:
#if DEBUG
                Debug.WriteLine("Last type: " + lastType);
#endif
                if (reader == null)
                {
                    throw new FormatException("Unknown property type: " + type + " (on " + name + ")");
                }
                throw new FormatException("Unknown property type: " + type + " (on " + name + " at " + reader.BaseStream.Position + ")");
            }
#if DEBUG
            lastType = type;
#endif
            if (reader != null)
            {
                data.Read(reader, includeHeader, leng);
            }
            return(data);
        }