package com.example.demo01.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

@Data
@TableName("monster")
public class Monster {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private Integer hp;
    private Integer maxHp;
    private Integer atk;
    private Integer def;
    private Integer expReward;
    private Integer goldReward;

    // 辅助方法：判断是否死亡
    public boolean isAlive() {
        return this.hp > 0;
    }
}