package com.alterdekim.game.entity;

import com.alterdekim.flash.decompiler.mapper.FlashClass;
import com.alterdekim.flash.decompiler.mapper.FlashField;
import com.alterdekim.flash.decompiler.mapper.FlashValue;
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@FlashClass(name = "sm")
@Entity
@Table(name = "smiles")
@JacksonXmlRootElement(localName = "smile")
public class Smile {
    @Id
    @FlashValue(type = FlashValueType.Id)
    @JacksonXmlProperty(isAttribute = true, localName = "Id")
    private Long id;

    @FlashField(name = "MRId")
    @Column(nullable = false)
    @JsonIgnore
    private Integer mRId;

    @FlashField(name = "BorderColor")
    @Column(nullable = true)
    @JsonIgnore
    private Integer borderColor;

    @FlashField(name = "BackgroundColor")
    @Column(nullable = true)
    @JsonIgnore
    private Integer backgroundColor;

    @JacksonXmlText
    public Integer val() {
        return this.mRId;
    }
}
