package com.alterdekim.game.component.game.response.location;

import com.alterdekim.game.entity.LocationObjectInstance;
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 com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@Getter
@NoArgsConstructor
@AllArgsConstructor
@JacksonXmlRootElement(localName = "location")
public class LocationObject {
    @JacksonXmlProperty(isAttribute = true, localName = "ID")
    private Long id;

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

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

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

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

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

    @JacksonXmlProperty(isAttribute = true)
    private Double x;

    @JacksonXmlProperty(isAttribute = true)
    private Double y;

    @JacksonXmlProperty(isAttribute = true, localName = "Name")
    private String name;

    @JacksonXmlProperty(isAttribute = true, localName = "OwnerId")
    private Integer ownerId;

    @JacksonXmlProperty(isAttribute = true, localName = "OwnerName")
    private String ownerName;

    @JacksonXmlProperty(isAttribute = false, localName = "object")
    @JacksonXmlElementWrapper(useWrapping = false, localName = "object")
    private List<LocationObjectInstance> objects;
}
