package com.alterdekim.game.component.game.inventory;

import com.alterdekim.game.xml.NumericBooleanSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public class InventoryGroup {
    @JacksonXmlProperty(isAttribute = true, localName = "ID")
    private int id;

    @JacksonXmlProperty(isAttribute = true, localName = "TextResourceID")
    private long textResourceId;

    @JacksonXmlProperty(isAttribute = true, localName = "IsUsed")
    @JsonSerialize(using = NumericBooleanSerializer.class)
    private Boolean isUsed;

    @JacksonXmlProperty(isAttribute = true, localName = "MediaResourceID")
    private long mediaResourceId;

    @JacksonXmlProperty(isAttribute = true, localName = "LayerID")
    private int layerId;

    @JacksonXmlProperty
    @JacksonXmlElementWrapper(useWrapping = false, localName = "items")
    private List<InventoryItem> items;
}
