feat(battle-engine): close the AI-simulation subsystem (verbatim)
Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
This commit is contained in:
63
SVSim.BattleEngine/Engine/Wizard/LeaderSkinUpdateTask.cs
Normal file
63
SVSim.BattleEngine/Engine/Wizard/LeaderSkinUpdateTask.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using LitJson;
|
||||
|
||||
namespace Wizard;
|
||||
|
||||
public class LeaderSkinUpdateTask : BaseTask
|
||||
{
|
||||
public class LeaderSkinUpdateTaskParam : BaseParam
|
||||
{
|
||||
public int class_id;
|
||||
|
||||
public int leader_skin_id;
|
||||
|
||||
public bool is_random_leader_skin;
|
||||
|
||||
public int[] leader_skin_id_list;
|
||||
}
|
||||
|
||||
private LeaderSkinUpdateTaskParam _param;
|
||||
|
||||
public LeaderSkinUpdateTask()
|
||||
{
|
||||
base.type = ApiType.Type.LeaderSkinUpdate;
|
||||
_param = null;
|
||||
}
|
||||
|
||||
public void SetParameter(int class_id, int leader_skin_id)
|
||||
{
|
||||
_param = new LeaderSkinUpdateTaskParam();
|
||||
_param.class_id = class_id;
|
||||
_param.leader_skin_id = leader_skin_id;
|
||||
_param.is_random_leader_skin = false;
|
||||
base.Params = _param;
|
||||
}
|
||||
|
||||
public void SetRandomParameter(int class_id, int[] leader_skin_id_list)
|
||||
{
|
||||
_param = new LeaderSkinUpdateTaskParam();
|
||||
_param.class_id = class_id;
|
||||
_param.leader_skin_id_list = leader_skin_id_list;
|
||||
_param.is_random_leader_skin = true;
|
||||
base.Params = _param;
|
||||
}
|
||||
|
||||
protected override int Parse()
|
||||
{
|
||||
int num = base.Parse();
|
||||
if (num != 1)
|
||||
{
|
||||
return num;
|
||||
}
|
||||
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
|
||||
ClassCharaPrm classPrm = dataMgr.GetClassPrm(_param.class_id);
|
||||
JsonData jsonData = base.ResponseData["data"];
|
||||
bool flag = jsonData["is_random_leader_skin"].ToBoolean();
|
||||
int num2 = 0;
|
||||
num2 = ((!flag) ? _param.leader_skin_id : jsonData["leader_skin_id"].ToInt());
|
||||
classPrm.SetLeaderRandomSkinIdList(jsonData["leader_skin_id_list"]);
|
||||
classPrm.IsRandomLeaderSkin = flag;
|
||||
ClassCharacterMasterData charaPrmBySkinId = dataMgr.GetCharaPrmBySkinId(num2);
|
||||
dataMgr.GetClassPrm(_param.class_id).SetCurrentCharaId(charaPrmBySkinId.chara_id);
|
||||
return num;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user