123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- using FL.Network;
- using System;
- using System.Collections.Generic;
- using XGame.Database;
- using XGame.Framework;
- using XGame.Framework.Data;
- namespace FL.Data
- {
- /// <summary>
- /// 职业类型
- /// </summary>
- public enum eCareerType
- {
- Novice = 0, // 初始职业
- Soldier, // 战士
- Shooter, // 弓箭手
- Magician, // 魔法师
- }
- /// <summary>
- /// 职业进阶类型
- /// </summary>
- public enum eAdvanceType
- {
- Beginner = 1, // 基础职业
- ShieldWarrior = 2, // 盾战士
- Berserker = 5, // 狂战士
- CriticalShooter =3,// 暴击射手
- ComboShooter =6, // 连击射手
- SpellMage = 4, // 咒术法师
- ViolentMage =7, // 暴力法师
- }
- public class PlayerData : DataSingleton<PlayerData>, IDisposable
- {
- public int[] skillIds = new int[] { 10011 };//13521;200705 ,
- public long UID { get; set; }
- public int ServerId { get; set; } // 所属分区
- public string Name { get; set; }
- private List<string> _runePlanNamesArray;// 方案名列表
- public List<string> RunePlanNamesArray => _runePlanNamesArray ??= new List<string>();
- private Attributes _attr;
- public Attributes Attr => _attr ??= ObjectPool.Acquire<Attributes>();
- private List<int> _jobHistoryList; //职业历史,记录转职的路径
- public List<int> JobHistoryList => _jobHistoryList ??= new List<int>();
- private Dictionary<int, RunePlan> _runePlanMap; //符文槽位(1-6)镶嵌的符文id(空值表示该槽位还未解锁)
- public Dictionary<int, RunePlan> RunePlanMap => _runePlanMap ??= new Dictionary<int, RunePlan>();
- /// <summary>
- /// 角色等级
- /// </summary>
- public int Level
- {
- get; set;
- }
- /// <summary>
- /// 当前经验值
- /// </summary>
- public long Exp
- {
- get; set;
- }
- /// <summary>
- /// 角色称号
- /// </summary>
- public string Title
- {
- get; set;
- }
- /// <summary>
- /// 角色头像
- /// </summary>
- public string HeadIcon { get; set; }
- /// <summary>
- /// 微信头像
- /// </summary>
- public string WXHeadIcon { get; set; }
- /// <summary>
- /// 累计充值金额
- /// </summary>
- public int Recharge { get; set; }
- /// <summary>
- /// 玩家战力
- /// </summary>
- public long Power { get; set; }
- /// <summary>
- /// 最好一次登陆时间(豪秒)
- /// </summary>
- public long LastLoginTime { get; set; }
- /// <summary>
- /// 当前职业id
- /// </summary>
- public int JobId { get; set; }
- /// <summary>
- /// 最近被重置过的职业id
- /// </summary>
- public int ResetJobId { get; set; }
- /// <summary>
- /// 当前的觉醒印记方案索引值
- /// </summary>
- public int CurPlanIndex { set; get; }
- /// <summary>
- /// (方案)可升级的总点数
- /// </summary>
- public int AllPoint { get; set; }
- /// <summary>
- /// 获取角色的转职次数
- /// </summary>
- /// <returns></returns>
- public int GetTransfersCount()
- {
- // 需要扣除初始职业
- return JobHistoryList.Count - 1;
- }
- void IDisposable.Dispose()
- {
- if (_attr != null)
- {
- ObjectPool.Recycle(_attr);
- _attr = null;
- }
- _runePlanMap?.Clear();
- _jobHistoryList?.Clear();
- _runePlanNamesArray?.Clear();
- }
- }
- }
|