using System;
using static ChatServer.util.NetUtil;

namespace ChatServer.util
{
  class Item
  {
    private readonly StateObject state;
    private readonly string message;
    private readonly byte[] packet;


    public Item(StateObject _state)
    {
      state = _state;
      message = MessageUtil.ConvertToMessage(_state.buffer);
      packet = MessageUtil.ConvertToPacket(message);
      //state.ClearBuffer();
    }

    public StateObject State 
    {
      get { return state; }
    }

    public string Message 
    {
      get { return message; }
    }

    public byte[] Packet
    {
      get { return packet; } 
    }
  }
}