using System; using System.Collections.Generic; using XGame.Database; using XGame.Framework.Data; namespace FL { public class MountData : DataSingleton, IDisposable { /// /// 每个星级(黄|紫|红)最多拥有5个星星数量 /// public const int MaxStarNum = 5; #region 通用坐骑数据 /// /// 通用坐骑的星阶对应的zuoqiInfo表的id /// public int UniversalId { get; set; } /// /// 通用坐骑升星进度条 /// public int UniversalExp { set; get; } /// /// 坐骑部位驯养经验条 /// public int MountPartExp { set; get; } /// /// 通用坐骑部位驯养等级数据 /// private Dictionary _mountsPartsMap; public Dictionary MountsPartsMap => _mountsPartsMap ??= new Dictionary(); #endregion #region 高级坐骑数据 /// /// 启用的高级坐骑的技能的坐骑id /// public int UseSkillMountId { set; get; } /// /// 已解锁的坐骑星级数据 /// key:zuoqiBase.id /// value:star(星级) /// private Dictionary _advancedMountsMap; public Dictionary AdvancedMountsMap => _advancedMountsMap ??= new Dictionary(); /// /// 高级坐骑是否已解锁状态 /// /// /// public bool IsUnLock(int advancedMountId) { return _advancedMountsMap.ContainsKey(advancedMountId); } /// /// 获取高级坐骑的星级 /// /// public int GetAdvancedMountLv(int mountId) { return _advancedMountsMap.ContainsKey(mountId) ? _advancedMountsMap[mountId] : 0; } #endregion public int MountModelId { set; get; } // 当前使用的坐骑外观模型id(通用坐骑用的是zuoqiInfo表格,高级坐骑对应的是zuoqiBase表格) /// /// 获取当前骑乘的坐骑外观 /// /// 是否需要返回通用已解锁的最高阶坐骑外观 /// public string GetRidingAppearance() { if (MountModelId == 0) return string.Empty; var mountBaseInfo = zuoqiBaseTableRepo.Get(MountModelId); if (mountBaseInfo != null) return mountBaseInfo.Spine; var mountInfo = zuoqiInfoTableRepo.Get(MountModelId); return mountInfo == null ? string.Empty : mountInfo.Spine; } void IDisposable.Dispose() { } } }