2015-03-10 23:41:21 +08:00
|
|
|
package torrent
|
|
|
|
|
2015-03-20 13:37:44 +08:00
|
|
|
import "github.com/anacrolix/torrent/data"
|
2015-03-10 23:41:21 +08:00
|
|
|
|
|
|
|
type statelessDataWrapper struct {
|
|
|
|
data.Data
|
|
|
|
complete []bool
|
|
|
|
}
|
|
|
|
|
|
|
|
func (me *statelessDataWrapper) PieceComplete(piece int) bool {
|
|
|
|
return me.complete[piece]
|
|
|
|
}
|
|
|
|
|
|
|
|
func (me *statelessDataWrapper) PieceCompleted(piece int) error {
|
|
|
|
me.complete[piece] = true
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (me *statelessDataWrapper) Super() interface{} {
|
|
|
|
return me.Data
|
|
|
|
}
|