package nori

import (
	"encoding/binary"
	"io"
)

type Plane struct {
	BitmapId   uint32
	PlaneX     int32
	PlaneY     int32
	Opacity    uint32
	Blend      BlendMode
	FlagParam  uint32
	RenderFlag uint32
}

func (p *Plane) Decode(r io.Reader) error {
	if err := binary.Read(r, end, &p.BitmapId); err != nil {
		return err
	}
	if err := binary.Read(r, end, &p.PlaneX); err != nil {
		return err
	}
	if err := binary.Read(r, end, &p.PlaneY); err != nil {
		return err
	}
	if err := binary.Read(r, end, &p.Opacity); err != nil {
		return err
	}
	if err := binary.Read(r, end, &p.RenderFlag); err != nil {
		return err
	}
	if err := binary.Read(r, end, &p.Blend); err != nil {
		return err
	}
	if err := binary.Read(r, end, &p.FlagParam); err != nil {
		return err
	}
	return nil
}
