using System.Collections.Generic;
|
|
namespace vnxbqy.UI
|
{
|
public class PhantasmPavilionChatBubbleHandler : IPhantasmPavilionTabHandler
|
{
|
PhantasmPavilionModel model { get { return ModelCenter.Instance.GetModel<PhantasmPavilionModel>(); } }
|
|
public string GetDescriptive(int id)
|
{
|
return ChatBubbleBoxConfig.Get(id).Descriptive;
|
}
|
|
public int GetExpireMinutes(int id)
|
{
|
return ChatBubbleBoxConfig.Get(id).ExpireMinutes;
|
}
|
|
public string GetImage(int id)
|
{
|
return ChatBubbleBoxConfig.Get(id).Icon;
|
}
|
|
public string GetName(int id)
|
{
|
return ChatBubbleBoxConfig.Get(id).Name;
|
}
|
|
public int GetSortNum(int id)
|
{
|
return ChatBubbleBoxConfig.Get(id).SortNum;
|
}
|
|
public List<int> GetTableKeys()
|
{
|
return model.StringListToIntList(ChatBubbleBoxConfig.GetKeys());
|
}
|
|
public int GetUnlockDefault(int id)
|
{
|
return ChatBubbleBoxConfig.Get(id).UnlockDefault;
|
}
|
|
public bool Has(int id)
|
{
|
return ChatBubbleBoxConfig.Has(id);
|
}
|
|
public void SendStarUPPack(int id)
|
{
|
model.SendCA236ChatBubbleBoxStarUP(id);
|
}
|
|
public void SendUsePack(int id)
|
{
|
model.SendCA230SetChatBubbleBox(id);
|
}
|
|
public bool TryGetAddStarAttr(int id, int star, out int[] addStarAttrTypeArr, out int[] addStarAttrValueArr)
|
{
|
addStarAttrTypeArr = new int[0];
|
addStarAttrValueArr = new int[0];
|
if (!ChatBubbleBoxStarConfig.TryGetIndex(id, star, out int index) || !ChatBubbleBoxStarConfig.Has(index))
|
return false;
|
ChatBubbleBoxStarConfig config = ChatBubbleBoxStarConfig.Get(index);
|
if (config.StarAttrType.IsNullOrEmpty() || config.StarAttrValue.IsNullOrEmpty() || config.StarAttrType.Length != config.StarAttrValue.Length)
|
return false;
|
addStarAttrTypeArr = config.StarAttrType;
|
addStarAttrValueArr = config.StarAttrValue;
|
return true;
|
}
|
|
public bool TryGetEffectID(int id, out int effectID)
|
{
|
effectID = 0;
|
return false;
|
}
|
|
public bool TryGetMaxStarLV(int id, out int maxStarLV)
|
{
|
return ChatBubbleBoxStarConfig.TryGetMaxStarLV(id, out maxStarLV);
|
}
|
|
public bool TryGetStarUpNeedItem(int id, int star, out int itemId, out int count)
|
{
|
itemId = 0;
|
count = 0;
|
if (!ChatBubbleBoxStarConfig.TryGetIndex(id, star, out int index) || !ChatBubbleBoxStarConfig.Has(index))
|
return false;
|
ChatBubbleBoxStarConfig config = ChatBubbleBoxStarConfig.Get(index);
|
if (config.StarUpNeedItemList.IsNullOrEmpty())
|
return false;
|
itemId = config.StarUpNeedItemList[0][0];
|
count = config.StarUpNeedItemList[0][1];
|
return true;
|
}
|
|
public bool TryGetUnLockAttr(int id, out int[] lightAttrTypeArr, out int[] lightAttrValueArr)
|
{
|
lightAttrTypeArr = new int[0];
|
lightAttrValueArr = new int[0];
|
if (!ChatBubbleBoxConfig.Has(id))
|
return false;
|
ChatBubbleBoxConfig config = ChatBubbleBoxConfig.Get(id);
|
if (config.LightAttrType.IsNullOrEmpty() || config.LightAttrValue.IsNullOrEmpty() || config.LightAttrType.Length != config.LightAttrValue.Length)
|
return false;
|
lightAttrTypeArr = config.LightAttrType;
|
lightAttrValueArr = config.LightAttrValue;
|
return true;
|
}
|
|
public bool TryGetUnLockNeedItem(int id, out int itemId, out int count)
|
{
|
itemId = 0;
|
count = 0;
|
if (!ChatBubbleBoxConfig.Has(id))
|
return false;
|
ChatBubbleBoxConfig config = ChatBubbleBoxConfig.Get(id);
|
|
if (config.UnlockNeedItemList.IsNullOrEmpty())
|
return false;
|
itemId = config.UnlockNeedItemList[0][0];
|
count = config.UnlockNeedItemList[0][1];
|
return true;
|
}
|
}
|
}
|