package com.example.demo.table;

import pers.jc.sql.Column;
import pers.jc.sql.Id;
import pers.jc.sql.Table;

/**
 * 数据库表格对象-房间PK结果记录
 */
@Table("room_game_record")
public class RoomGameRecord {
    @Id
    private String roomKey = "";
    @Column
    int gameType;
    @Column
    private int p1ID;
    @Column
    private int p2ID;
    @Column
    private int gameRes;
    @Column
    private long settleTime = System.currentTimeMillis();
    @Column
    private String playerIDSeq = "";

    public RoomGameRecord() {}

    public RoomGameRecord(String roomKey, int gameType, int p1ID, int p2ID, int gameRes) {
        this.roomKey = roomKey;
        this.gameType = gameType;
        this.p1ID = p1ID;
        this.p2ID = p2ID;
        this.gameRes = gameRes;
        playerIDSeq = p1ID < p2ID ? p1ID + "&" + p2ID : p2ID + "&" + p1ID;
    }

    public String getRoomKey() {
        return roomKey;
    }

    public void setRoomKey(String roomKey) {
        this.roomKey = roomKey;
    }

    public int getGameType() {
        return gameType;
    }

    public void setGameType(int gameType) {
        this.gameType = gameType;
    }

    public int getP1ID() {
        return p1ID;
    }

    public void setP1ID(int p1ID) {
        this.p1ID = p1ID;
    }

    public int getP2ID() {
        return p2ID;
    }

    public void setP2ID(int p2ID) {
        this.p2ID = p2ID;
    }

    public int getGameRes() {
        return gameRes;
    }

    public void setGameRes(int gameRes) {
        this.gameRes = gameRes;
    }

    public long getSettleTime() {
        return settleTime;
    }

    public void setSettleTime(long settleTime) {
        this.settleTime = settleTime;
    }

    public String getPlayerIDSeq() {
        return playerIDSeq;
    }

    public void setPlayerIDSeq(String playerIDSeq) {
        this.playerIDSeq = playerIDSeq;
    }
}
