48 lines
1.2 KiB
C#
Executable File
48 lines
1.2 KiB
C#
Executable File
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace ET
|
|
{
|
|
public class JobHelper
|
|
{
|
|
/// <summary>
|
|
/// 获取JobType
|
|
/// </summary>
|
|
/// <param name="jobId"></param>
|
|
/// <returns> 1 2 3 4</returns>
|
|
public static JobType GetJobType(int jobId)
|
|
{
|
|
return (JobType)GetJobById(jobId);
|
|
}
|
|
public static int GetJobById(int jobId)
|
|
{
|
|
return (jobId + 1) / 2;
|
|
}
|
|
public static SexType GetSexType(int jobId)
|
|
{
|
|
return jobId % 2 == 0 ?SexType.Famale:SexType.Male;
|
|
}
|
|
public static string GetStrJob(int jobId,int trans = 0)
|
|
{
|
|
string ext = trans switch
|
|
{
|
|
0 => "",
|
|
1 => "(一转)",
|
|
2 => "(二转)",
|
|
_ => throw new Exception("转生值错误"),
|
|
};
|
|
return GetJobType(jobId) switch
|
|
{
|
|
JobType.Officer => "军官",
|
|
JobType.Sportsman => "运动员",
|
|
JobType.Nurse => "护士",
|
|
JobType.Superman => "超能力",
|
|
_ => throw new Exception("职业类型错误"),
|
|
} + ext;
|
|
|
|
|
|
}
|
|
}
|
|
}
|