Example #1
0
        public static EleGraphicalData ReadFromStream(EleInstance instance, BigEndianReader reader)
        {
            var id   = reader.ReadInt();
            var type = (EleGraphicalElementTypes)reader.ReadByte();

            switch (type)
            {
            case EleGraphicalElementTypes.ANIMATED:
                return(AnimatedGraphicalElementData.ReadFromStream(instance, id, reader));

            case EleGraphicalElementTypes.BLENDED:
                return(BlendedGraphicalElementData.ReadFromStream(instance, id, reader));

            case EleGraphicalElementTypes.BOUNDING_BOX:
                return(BoundingBoxGraphicalElementData.ReadFromStream(instance, id, reader));

            case EleGraphicalElementTypes.NORMAL:
                return(NormalGraphicalElementData.ReadFromStream(instance, id, reader));

            case EleGraphicalElementTypes.ENTITY:
                return(EntityGraphicalElementData.ReadFromStream(instance, id, reader));

            case EleGraphicalElementTypes.PARTICLES:
                return(ParticlesGraphicalElementData.ReadFromStream(instance, id, reader));

            default:
                throw new Exception("Unknown graphical data of type " + type);
            }
        }
Example #2
0
        public static ParticlesGraphicalElementData ReadFromStream(EleInstance instance, int id, BigEndianReader reader)
        {
            var data = new ParticlesGraphicalElementData(instance, id);

            data.ScriptId = reader.ReadShort();

            return(data);
        }