72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
using cfg.LegionBattleCfg;
|
|
using Framework;
|
|
using NLDPB;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using static LegionLevelData;
|
|
using static UINoticeOneController;
|
|
|
|
namespace Gameplay.LegionBattle
|
|
{
|
|
/// <summary>
|
|
/// 军团战建筑数据
|
|
/// </summary>
|
|
public sealed class LegionBuildingData
|
|
{
|
|
/// <summary>
|
|
/// 建筑索引
|
|
/// </summary>
|
|
public int Index { get; private set; }
|
|
/// <summary>
|
|
/// 建筑坐标
|
|
/// </summary>
|
|
public Vector2Int Coordinate { get; private set; }
|
|
/// <summary>
|
|
/// 建筑内的玩家
|
|
/// </summary>
|
|
public List<int> listActorId { get; private set; }
|
|
/// <summary>
|
|
/// 当前阵营
|
|
/// </summary>
|
|
public BattlefieldActorCamp CurCamp { get; private set; }
|
|
/// <summary>
|
|
/// 防守成功次数
|
|
/// </summary>
|
|
public int DefenceCount { get; private set; }
|
|
/// <summary>
|
|
/// 被攻占次数
|
|
/// </summary>
|
|
public int AttackedTotal { get; private set; }
|
|
/// <summary>
|
|
/// 据点配置
|
|
/// </summary>
|
|
public DataLegionBattleBuilding Cfg { get; private set; }
|
|
|
|
public LegionBuildingData(int cellIndex, int cfgId)
|
|
{
|
|
Index = cellIndex;
|
|
listActorId = new List<int>();
|
|
|
|
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;
|
|
}
|
|
}
|
|
} |