文字游戏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

115 lines
3.4 KiB

using SqlSugar;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Build_God_Api.DB
{
/// <summary>
/// 任务实体(修仙游戏)
/// </summary>
public class Mission : BaseEntity
{
/// <summary>
/// 任务名称
/// </summary>
[SugarColumn(Length = 50, IsNullable = false)]
public string Name { get; set; } = string.Empty;
/// <summary>
/// 任务类型
/// </summary>
[SugarColumn(IsNullable = false)]
public MissionType Type { get; set; } = MissionType.Collection;
/// <summary>
/// 任务标题(展示用,与Name不同)
/// </summary>
[SugarColumn(Length = 100, IsNullable = false)]
public string Title { get; set; } = string.Empty;
/// <summary>
/// 任务简介
/// </summary>
[SugarColumn(Length = 500, IsNullable = false)]
public string Description { get; set; } = string.Empty;
/// <summary>
/// 需求修为境界ID
/// </summary>
[SugarColumn(IsNullable = false)]
public int RequiredLevelId { get; set; } = 1;
/// <summary>
/// 是否可以重复接取
/// true-无限/每日重置,false-仅可接取一次
/// </summary>
[SugarColumn(IsNullable = false)]
public bool Repeatable { get; set; } = false;
/// <summary>
/// 是否可接取(true-可接,false-未开放)
/// </summary>
[SugarColumn(IsNullable = false, DefaultValue = "0")]
public bool IsAvailable { get; set; } = false;
/// <summary>
/// 任务花费时间(分钟)
/// </summary>
[SugarColumn(IsNullable = false, DefaultValue = "0")]
public int SpendTimeMinutes { get; set; } = 0;
/// <summary>
/// 任务获取概率(0-100,百分比)
/// </summary>
[Range(0, 100)]
[SugarColumn(IsNullable = false, DefaultValue = "100")]
public decimal ObtainPercentage { get; set; } = 100;
/// <summary>
/// 前置任务ID(0代表无前置)
/// </summary>
[SugarColumn(IsNullable = false, DefaultValue = "0")]
public int PreMissionId { get; set; } = 0;
/// <summary>
/// 任务难度
/// </summary>
[SugarColumn(IsNullable = false)]
public MissionDifficulty Difficulty { get; set; } = MissionDifficulty.Normal;
//这里不能给rewards初始化,不然导航属性会没办法查询到数据
[SqlSugar.Navigate(SqlSugar.NavigateType.OneToMany, nameof(MissionReward.MissionId), nameof(Id))]
public List<MissionReward>? Rewards { get; set; }
[SqlSugar.Navigate(SqlSugar.NavigateType.OneToMany, nameof(MissionProgress.MissionId), nameof(Id))]
public List<MissionProgress>? Progresses { get; set; }
}
/// <summary>
/// 任务类型枚举
/// </summary>
public enum MissionType
{
[Description("收集任务")]
Collection = 1,
[Description("狩猎任务")]
Hunting = 2
}
/// <summary>
/// 任务难度枚举
/// </summary>
public enum MissionDifficulty
{
[Description("普通")]
Normal = 1,
[Description("困难")]
Hard = 2,
[Description("炼狱")]
Purgatory = 3
}
}