package com.alterdekim.game.entity;

import com.alterdekim.flash.decompiler.mapper.FlashValue;
import com.alterdekim.flash.decompiler.mapper.FlashValueType;
import com.alterdekim.game.xml.NumericBooleanSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
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;

@Entity
@Table(name = "minigames")
@AllArgsConstructor
@NoArgsConstructor
@Getter
public class MiniGame {
    @Id
    @JacksonXmlProperty(isAttribute = true, localName = "ID")
    private Long id;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "GameName")
    private String gameName;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "NameTRId")
    private Integer nameTRId;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "TextResourceID")
    private Integer textResourceID;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "MediaResourceID")
    private Integer mediaResourceID;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "ScoreDivisor")
    private Double scoreDivisor;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "AvatarType")
    private Integer avatarType;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "IsPromptUsed")
    @JsonSerialize(using = NumericBooleanSerializer.class)
    private Boolean isPromptUsed;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "IsFullscreen")
    @JsonSerialize(using = NumericBooleanSerializer.class)
    private Boolean isFullscreen;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "IsShowPoints")
    @JsonSerialize(using = NumericBooleanSerializer.class)
    private Boolean isShowPoints;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "StartFullTime")
    private Long startFullTime;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "StartLackTime")
    private Long startLackTime;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "Options")
    private String options;

    @Column(nullable = false)
    @JacksonXmlProperty(isAttribute = true, localName = "Token")
    private String token;
}
