yyl
2026-01-21 69fdc58cb97714f856df268f08451f2ba7e5ecf2
Main/System/Team/TeamBase.cs
@@ -19,20 +19,19 @@
    // 服务器下发的阵型和阵容,只能通过网络协议赋值,外部只读
    public TeamType teamType
    public int teamType
    {
        get;
        private set;
    }
    private int ShapeType;
    public int ServerShapeType { get; private set; }
    public TeamHero[] tempHeroes { get; private set; }  = new TeamHero[TeamConst.MaxTeamHeroCount];
    public TeamHero[] serverHeroes { get; private set; } = new TeamHero[TeamConst.MaxTeamHeroCount];
    public TeamBase(TeamType _teamType)
    public TeamBase(int _teamType)
    {
        teamType = _teamType;
        teamIndex = 0;
@@ -49,8 +48,6 @@
        }
        teamIndex = lineUp.Num;
        playerId = lineUp.OwnerID;
        ShapeType = lineUp.ShapeType;
        ServerShapeType = lineUp.ShapeType;
        for (int i = 0; i < lineUp.ObjCnt; i++)
        {
@@ -110,7 +107,6 @@
        CB412_tagCSHeroPresetSave savePack = new CB412_tagCSHeroPresetSave();
        savePack.PresetID = (byte)teamType;
        savePack.ShapeType = (byte)ShapeType;
        savePack.PosCnt = (byte)GetTeamHeroCount();
        savePack.HeroPosList = new CB412_tagCSHeroPresetSave.tagCSHeroPresetPos[savePack.PosCnt];
@@ -141,30 +137,20 @@
        //非主线阵容客户端自己做战力变化,主线阵容服务端战力变更会同步推送
    }
    public void OnChangeShapeType(int newShapeType)
    {
        ShapeType = newShapeType;
    }
    public void OnServerChangeShapeType(int newShapeType)
    {
        ServerShapeType = newShapeType;
        ShapeType = newShapeType;
    }
    
    public void RefreshServerData(int shapeType, int positionIndex, HeroInfo heroInfo)
    public void RefreshServerData(int positionIndex, HeroInfo heroInfo)
    {
        TeamHero teamHero = heroInfo == null ? null : new TeamHero(heroInfo, positionIndex, this);
        SetServerTeamHero(positionIndex, teamHero);
        OnServerChangeShapeType(shapeType);
    }
    public void CreateDefault(List<HeroInfo> heroInfos)
    {
        teamIndex = 0;
        playerId = PlayerDatas.Instance.baseData.PlayerID;
        OnServerChangeShapeType(0);
        for (int i = 0; i < heroInfos.Count; i++)
        {