using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IO;

namespace HaloPlugins
{
    public class Padding : IMetaNode
    {
        int Size;
        byte[] Data;

        public Padding(int Size)
        {
            this.Size = Size;
            Data = new byte[Size];
        }

        #region MetaNode Members

        public void Read(EndianReader br)
        {
            Data = br.ReadBytes(Size);
        }

        public void Read(EndianReader br, int Magic)
        {
            Data = br.ReadBytes(Size);
        }

        public void Write(EndianWriter bw)
        {
            bw.Write(Data);
        }

        public object GetValue()
        {
            throw new NotImplementedException();
        }

        public void SetValue(object Value)
        {
            throw new NotImplementedException();
        }

        public int GetSize()
        {
            return Size;
        }

        public void Compile(EndianWriter bw, int Magic)
        {
            bw.Write(Data);
        }

        public void Decompile(EndianWriter bw, int Magic)
        {
            bw.Write(Data);
        }

        public string GetName()
        {
            throw new NotImplementedException();
        }

        #endregion

        #region ICloneable Members

        public object Clone()
        {
            Padding u = new Padding(Size);
            Array.Copy(Data, u.Data, Size);
            return u;
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            return "Unused: " + Size.ToString();
        }

        #endregion
    }
}
