using cfg.LegionBattleCfg; using Framework; using NLDPB; using System.Collections.Generic; using UnityEngine; using static LegionLevelData; using static UINoticeOneController; namespace Gameplay.LegionBattle { /// /// 军团战建筑数据 /// public sealed class LegionBuildingData { /// /// 建筑索引 /// public int Index { get; private set; } /// /// 建筑坐标 /// public Vector2Int Coordinate { get; private set; } /// /// 建筑内的玩家 /// public List listActorId { get; private set; } /// /// 当前阵营 /// public BattlefieldActorCamp CurCamp { get; private set; } /// /// 防守成功次数 /// public int DefenceCount { get; private set; } /// /// 被攻占次数 /// public int AttackedTotal { get; private set; } /// /// 据点配置 /// public DataLegionBattleBuilding Cfg { get; private set; } public LegionBuildingData(int cellIndex, int cfgId) { Index = cellIndex; listActorId = new List(); Cfg = TableManager.Instance.Tables.LegionBattleBuilding.Get(cfgId); } public void CopyData(MSG_LB_Building data) { Coordinate = new Vector2Int((int)data.Nz, (int)data.Nx); listActorId.Clear(); for (int i = 0; i < data.Actors.Count; ++i) { listActorId.Add((int)data.Actors[i]); } CurCamp = BattlefieldActorCamp.BacNone; } public void CopyData(BattlefieldActorCamp camp, int defCount, int total) { CurCamp = camp; DefenceCount = defCount; AttackedTotal = total; } } }