public static YkdResourceViewport ReadFromStream(YkdResourceViewportType type, Stream stream)
        {
            YkdResourceViewport result;

            switch (type)
            {
            case YkdResourceViewportType.Empty:
                result = new EmptyYkdResourceViewport();
                break;

            case YkdResourceViewportType.Full:
                result = new FullYkdResourceViewport();
                break;

            case YkdResourceViewportType.Fragment:
                result = new FragmentYkdResourceViewport();
                break;

            case YkdResourceViewportType.Extra:
                result = new ExtraYkdResourceViewport();
                break;

            default:
                throw new NotImplementedException(type.ToString());
            }

            result.ReadFromStream(stream);
            return(result);
        }
        public static YkdResourceViewport ReadFromStream(YkdResourceViewportType type, Stream stream)
        {
            YkdResourceViewport result;

            switch (type)
            {
                case YkdResourceViewportType.Empty:
                    result = new EmptyYkdResourceViewport();
                    break;
                case YkdResourceViewportType.Full:
                    result = new FullYkdResourceViewport();
                    break;
                case YkdResourceViewportType.Fragment:
                    result = new FragmentYkdResourceViewport();
                    break;
                case YkdResourceViewportType.Extra:
                    result = new ExtraYkdResourceViewport();
                    break;
                default:
                    throw new NotImplementedException(type.ToString());
            }

            result.ReadFromStream(stream);
            return result;
        }
Beispiel #3
0
 public void ReadFromStream(Stream stream)
 {
     BinaryReader br = new BinaryReader(stream);
     Type = (YkdResourceViewportType)br.ReadInt32();
     Index = br.ReadInt32();
     Dummy2 = br.Check(r => r.ReadInt32(), 0);
     Dummy3 = br.Check(r => r.ReadInt32(), 0);
     Name = stream.ReadFixedSizeString(NameSize, YkdFile.NamesEncoding);
     Viewport = YkdResourceViewport.ReadFromStream(Type, stream);
 }
Beispiel #4
0
        public void ReadFromStream(Stream stream)
        {
            BinaryReader br = new BinaryReader(stream);

            Type     = (YkdResourceViewportType)br.ReadInt32();
            Index    = br.ReadInt32();
            Dummy2   = br.Check(r => r.ReadInt32(), 0);
            Dummy3   = br.Check(r => r.ReadInt32(), 0);
            Name     = stream.ReadFixedSizeString(NameSize, YkdFile.NamesEncoding);
            Viewport = YkdResourceViewport.ReadFromStream(Type, stream);
        }