| | |
| | | |
| | | |
| | | // 服务器下发的阵型和阵容,只能通过网络协议赋值,外部只读 |
| | | 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; |
| | |
| | | } |
| | | teamIndex = lineUp.Num; |
| | | playerId = lineUp.OwnerID; |
| | | ShapeType = lineUp.ShapeType; |
| | | ServerShapeType = lineUp.ShapeType; |
| | | |
| | | for (int i = 0; i < lineUp.ObjCnt; i++) |
| | | { |
| | |
| | | |
| | | 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]; |
| | | |
| | |
| | | //非主线阵容客户端自己做战力变化,主线阵容服务端战力变更会同步推送 |
| | | } |
| | | |
| | | 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++) |
| | | { |