| | |
| | | public MonthlyInvestmentModel.MonthlyInvestmentItem FairyJadeInvestmentItem;//奖励
|
| | | }
|
| | | [XLua.LuaCallCSharp]
|
| | | public class FairyJadeInvestmentModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
|
| | | public class FairyJadeInvestmentModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
|
| | | {
|
| | | public Dictionary<int, FairyJadeInvestmentClass> FairyJadeInvestmentDic = new Dictionary<int, FairyJadeInvestmentClass>();//等级
|
| | | public Dictionary<int, int> InfoSeriors = new Dictionary<int, int>();//奖励领取信息//key为索引,Value(0,未领,其他值未领的钱数)
|
| | | public Dictionary<int, FairyJadeInvestmentClass> FairyJadeInvestmentDic = new Dictionary<int, FairyJadeInvestmentClass>();//等级(0-300级)
|
| | | public Dictionary<int, Dictionary<int, FairyJadeInvestmentClass>> FairyJadeInvestmentTypeDic = new Dictionary<int, Dictionary<int, FairyJadeInvestmentClass>>();//根据投资类型来存储奖励类型和金额(类型3,4,5);
|
| | | public Dictionary<int, int> InfoSeriors = new Dictionary<int, int>();//奖励领取信息//key为索引,Value(0,未领,其他值未领的钱数)等级(0-300级)
|
| | | public Dictionary<int, int> InfoSeriorsTwo = new Dictionary<int, int>();//奖励领取信息//key为索引,Value(0,未领,其他值未领的钱数)等级(301-400)
|
| | | public Dictionary<int, int> InvestmentAmountDic = new Dictionary<int, int>();//投资金额
|
| | | public static Action FairyJadeInfoSeriorsUpdate;
|
| | | public int InvestGold = 0; // 投资额度
|
| | |
| | | FairyJadeInvestmentDic.Clear();
|
| | | InvestmentAmountDic.Clear();
|
| | | InfoSeriors.Clear();
|
| | | InfoSeriorsTwo.Clear();
|
| | | Assignment();
|
| | |
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public void AssignmentType()
|
| | | {
|
| | | //根据投资类型来存储奖励信息(类型3,4,5)
|
| | | if (FairyJadeInvestmentTypeDic.Count >= 3)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var InvestConfig = Config.Instance.GetAllValues<InvestConfig>();
|
| | | foreach (var value in InvestConfig)
|
| | | {
|
| | | if ((value.type == 3 || value.type == 4 || value.type == 5))
|
| | | {
|
| | | if (!FairyJadeInvestmentTypeDic.ContainsKey(value.type))
|
| | | {
|
| | | Dictionary<int, FairyJadeInvestmentClass> Dic = new Dictionary<int, FairyJadeInvestmentClass>();
|
| | | FairyJadeInvestmentClass fairyJadeInvestment = new FairyJadeInvestmentClass();
|
| | | if (value.id >= 310)
|
| | | {
|
| | | fairyJadeInvestment.ID = value.id % 100;
|
| | | }
|
| | | else
|
| | | {
|
| | | fairyJadeInvestment.ID = value.id % 10;
|
| | | }
|
| | | fairyJadeInvestment.Type = value.type;
|
| | | fairyJadeInvestment.NeedDay = value.needDay;
|
| | | fairyJadeInvestment.NeedLv = value.needLV;
|
| | | MonthlyInvestmentModel.MonthlyInvestmentItem FairyJadeItem = new MonthlyInvestmentModel.MonthlyInvestmentItem();
|
| | | var _jsonData = LitJson.JsonMapper.ToObject(value.award);
|
| | | foreach (string key in _jsonData.Keys)
|
| | | {
|
| | | var _job = int.Parse(key);
|
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | FairyJadeItem.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | }
|
| | | }
|
| | | fairyJadeInvestment.FairyJadeInvestmentItem = FairyJadeItem;
|
| | | Dic.Add(value.needLV, fairyJadeInvestment);
|
| | | FairyJadeInvestmentTypeDic.Add(value.type, Dic);
|
| | | }
|
| | | else
|
| | | {
|
| | | var dict = FairyJadeInvestmentTypeDic[value.type];
|
| | | FairyJadeInvestmentClass fairyJadeInvestment = new FairyJadeInvestmentClass();
|
| | | if (value.id >= 310)
|
| | | {
|
| | | fairyJadeInvestment.ID = value.id % 100;
|
| | | }
|
| | | else
|
| | | {
|
| | | fairyJadeInvestment.ID = value.id % 10;
|
| | | }
|
| | | fairyJadeInvestment.Type = value.type;
|
| | | fairyJadeInvestment.NeedDay = value.needDay;
|
| | | fairyJadeInvestment.NeedLv = value.needLV;
|
| | | MonthlyInvestmentModel.MonthlyInvestmentItem FairyJadeItem = new MonthlyInvestmentModel.MonthlyInvestmentItem();
|
| | | var _jsonData = LitJson.JsonMapper.ToObject(value.award);
|
| | | foreach (string key in _jsonData.Keys)
|
| | | {
|
| | | var _job = int.Parse(key);
|
| | | var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
|
| | | for (int j = 0; j < _itemArray.Length; j++)
|
| | | {
|
| | | FairyJadeItem.Add(_job, new AwardItem()
|
| | | {
|
| | | item = new Item(_itemArray[j][0], _itemArray[j][1]),
|
| | | isBind = _itemArray[j][2],
|
| | | });
|
| | | }
|
| | | }
|
| | | fairyJadeInvestment.FairyJadeInvestmentItem = FairyJadeItem;
|
| | | if (!dict.ContainsKey(value.needLV))
|
| | | {
|
| | | dict.Add(value.needLV, fairyJadeInvestment);
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | dict[value.needLV] = fairyJadeInvestment;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | // DebugEx.LogError(FairyJadeInvestmentTypeDic);
|
| | | }
|
| | |
|
| | | public void Assignment()
|
| | | {
|
| | | // AssignmentType();
|
| | | var InvestConfig = Config.Instance.GetAllValues<InvestConfig>();
|
| | | if (FairyJadeInvestmentDic.Count > 0)
|
| | | {
|
| | |
| | | FairyJadeInvestmentDic.Add(value.needLV, fairyJadeInvestment);
|
| | | }
|
| | | }
|
| | | // DebugEx.LogError(FairyJadeInvestmentDic);
|
| | | }
|
| | |
|
| | | public void GetInfoSeriors(HA337_tagMCGoldInvestInfo vNetData)//接受信息
|
| | | {
|
| | | if (vNetData.InvestType == 3)
|
| | |
| | | {
|
| | | redPointStre1.state = RedPointState.Simple;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | else
|
| | | {
|