|
using System.Collections.Generic;
|
using UnityEngine;
|
|
//阵容布阵
|
public partial class HeroInfo
|
{
|
public Dictionary<TeamType, KeyValuePair<int, int>> GetTeamTypeShapeTypePositionDict()
|
{
|
// 英雄当前所有在的队伍
|
List<int> heroTeams = itemHero.GetUseData(81);
|
|
Dictionary<TeamType, KeyValuePair<int, int>> teamTypeShapeTypePositionDict = new Dictionary<TeamType, KeyValuePair<int, int>>();
|
foreach (var teamMsg in heroTeams)
|
{
|
// 所在阵容信息列表 [阵容类型*10000+阵型类型*100+位置编号, ...]
|
int teamType = teamMsg / 10000;
|
int shapeType = (teamMsg % 10000) / 100;
|
int positionIndex = teamMsg % 100;
|
|
if (teamTypeShapeTypePositionDict.ContainsKey((TeamType)teamType))
|
{
|
// 队伍类型相同,更新阵型和位置
|
Debug.LogError("当前英雄拥有两个相同的队伍信息: " + teamType + " " + shapeType + " " + positionIndex + ", hero guid is " + itemHero.guid);
|
}
|
else
|
{
|
// 队伍类型不同,添加新的
|
KeyValuePair<int, int> shapeTypePosition = new KeyValuePair<int, int>(shapeType, positionIndex);
|
teamTypeShapeTypePositionDict.Add((TeamType)teamType, shapeTypePosition);
|
}
|
}
|
|
return teamTypeShapeTypePositionDict;
|
}
|
}
|