NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Utils/GoalParse.cs

93 lines
3.1 KiB
C#

using System.Numerics;
using Gameplay.Level;
using UnityEngine;
namespace Utils.Language
{
//解析
public class GoalParse
{
private LevelData.Goal _goal;
public static string ParseGoal(LevelData.Goal goal)
{
string retStr = "";
string str0 = "";
string str1 = "";
string str2 = "";
Vector2Int pos = goal.position;
string posStr = "(" + pos.x + "," + pos.y + ")";
switch (goal.goalType)
{
case (LevelData.Goal.GoalType.Occupy):
{
str0 = CommonUtils.GetLocalizeText("fight_occupy");
retStr = str0;
break;
}
case (LevelData.Goal.GoalType.FallBack):
{
str0 = CommonUtils.GetLocalizeText("fight_fallback");
retStr = str0;
break;
}
case (LevelData.Goal.GoalType.Destroy):
{
str0 = CommonUtils.GetLocalizeText("fight_detroy");
retStr = str0;
break;
}
case (LevelData.Goal.GoalType.KillAll):
{
str0 = CommonUtils.GetLocalizeText("fight_kill_all");
retStr = str0;
break;
}
}
return retStr + posStr;
}
public static string ParseStarGoal(LevelData.StarGoal goal)
{
string retStr = "";
if (goal.starGoalType == null)
{
}
switch (goal.starGoalType)
{
case(LevelData.StarGoal.StarGoalType.AllAlive):
{
retStr = CommonUtils.GetLocalizeText("fight_all_alive");
break;
}
case (LevelData.StarGoal.StarGoalType.LeastJob):
{
string jobStr = CommonUtils.GetLocalizeText("job_" + (int)goal.job);
retStr = CommonUtils.GetLocalizeText("fight_use_job", goal.count, jobStr);
break;
}
case (LevelData.StarGoal.StarGoalType.LeastFaction):
{
string factionStr = CommonUtils.GetLocalizeText("troop_" + (int)goal.faction);
retStr = CommonUtils.GetLocalizeText("fight_use_troop", goal.count, factionStr);
break;
}
case(LevelData.StarGoal.StarGoalType.LeastRarity):
{
retStr = CommonUtils.GetLocalizeText("fight_use_rarity", goal.count, goal.rarity);
break;
}
case (LevelData.StarGoal.StarGoalType.LeastTime):
{
string timeStr = CommonUtils.GetTimeDescStr(goal.time);
retStr = CommonUtils.GetLocalizeText("fight_use_least_time", timeStr);
break;
}
}
return retStr;
}
}
}