NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/LegionBattle/Data/LegionBuildingInfo.cs

68 lines
1.8 KiB
C#

using NLDPB;
using System.Collections.Generic;
using UnityEngine;
namespace Gameplay.LegionBattle
{
/// <summary>
/// 军团战建筑数据
/// </summary>
public sealed class LegionBuildingInfo
{
/// <summary>
/// 建筑索引
/// </summary>
public int Index { get; private set; }
/// <summary>
/// 建筑id
/// </summary>
public int ID { 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; }
public LegionBuildingInfo()
{
listActorId = new List<int>();
}
public void CopyInfo(MSG_LB_Building info)
{
Index = (int)info.Index;
ID = (int)info.Id;
Coordinate = new Vector2Int((int)info.Nz, (int)info.Nx);
listActorId.Clear();
for (int i = 0; i < info.Actors.Count; ++i)
{
listActorId.Add((int)info.Actors[i]);
}
CurCamp = BattlefieldActorCamp.BacNone;
}
public void CopyInfo(BattlefieldActorCamp camp, int defCount, int total)
{
CurCamp = camp;
DefenceCount = defCount;
AttackedTotal = total;
}
}
}