/*
Copyright (C) 2005 David Green <green@couchpotato.net>

This file is part of I3J.

I3J is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

I3J is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with I3J; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

package com.aelfengard.i3.packet;

import java.util.Collections;
import java.util.List;

import com.aelfengard.i3.LPCUtils;
import com.aelfengard.i3.LPCMixed;

public class MudListPacket extends I3Packet {

    public static final String TOKEN = "mudlist";
    
    private LPCMixed originatorMudName = new LPCMixed("");
    private LPCMixed targetMudName = new LPCMixed("");
    private LPCMixed mudlistId = new LPCMixed(0);
    private LPCMixed infoMapping = new LPCMixed(Collections.emptyMap());
    
    public MudListPacket() {
        super(I3Packet.Type.MUD_LIST);
    }
    
    public MudListPacket(List<LPCMixed> args) {
        this();
        originatorMudName = args.get(2);
        targetMudName = args.get(4);
        mudlistId = args.get(6);
        infoMapping = args.get(7);
    }
    
    public List<LPCMixed> toList() {
        return LPCUtils.makeList(
                TOKEN,
                5, // spec says must be 5
                originatorMudName,
                0, // spec says must be 0
                targetMudName,
                0, // spec says must be 0
                mudlistId,
                infoMapping
                );
    }

    public LPCMixed getInfoMapping() {
        return infoMapping;
    }
    

    public void setInfoMapping(LPCMixed infoMapping) {
        this.infoMapping = infoMapping;
    }
    

    public LPCMixed getMudlistId() {
        return mudlistId;
    }
    

    public void setMudlistId(LPCMixed mudlistId) {
        this.mudlistId = mudlistId;
    }
    

    public LPCMixed getOriginatorMudName() {
        return originatorMudName;
    }
    

    public void setOriginatorMudName(LPCMixed originatorMudName) {
        this.originatorMudName = originatorMudName;
    }
    

    public LPCMixed getTargetMudName() {
        return targetMudName;
    }
    

    public void setTargetMudName(LPCMixed targetMudName) {
        this.targetMudName = targetMudName;
    }

}