Files
test/Assets/PerfectWorld/Scripts/Managers/EC_Faction.cs

83 lines
2.1 KiB
C#

using BrewMonster.Network;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace BrewMonster
{
public class Faction_Info
{
public uint m_id;
public string m_szName;
public int m_nLev;
public int m_nMemNum;
public int GetLevel()
{
return m_nLev;
}
}
public class CECFactionMan
{
Dictionary<uint, Faction_Info> m_FactionMap;
public List<int> m_alliance = new List<int>();
public Faction_Info GetFaction(uint uId, bool bRequestFromServer)
{
if (!m_FactionMap.TryGetValue(uId, out var it))
{
if (bRequestFromServer)
UnityGameSession.Instance.GetFactionInfo(1, new int[] { (int)uId });
return null;
}
return it;
}
public bool IsFactionAlliance(int fid)
{
if (fid == 0)
return false;
foreach (var f in m_alliance)
{
if (f == fid)
return true;
}
return false;
}
private Dictionary<int, Faction_Mem_Info> m_MemMap;
public Faction_Mem_Info GetMember(int roleId)
{
if (m_MemMap.TryGetValue(roleId, out var member))
return member;
return null;
}
}
public class Faction_Mem_Info
{
public int RoleId { get; set; }
public int FRoleId { get; set; }
public int Level { get; set; }
public int Profession { get; set; }
public byte OnlineStatus { get; set; }
public byte Gender { get; set; }
public int LoginTime { get; set; }
public string Name { get; set; } = string.Empty;
public string NickName { get; set; } = string.Empty;
public int Contrib { get; set; }
public bool DelayExpel { get; set; }
public uint ExpelEndTime { get; set; }
public int Reputation { get; set; }
public int ReincarnationTimes { get; set; }
public bool IsOnline => OnlineStatus != 0;
}
}