少年修仙传客户端代码仓库
xingchen Qiu
2019-04-08 70cdf2c86fc687c6905525ca0a316768a3458954
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    [XLua.LuaCallCSharp]
    [XLua.Hotfix]
    public class AllianceBossModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
    {
        public const int DATAMAPID = 31260;
        public bool isActivityOver { get; private set; }
        public int participateLimit { get; private set; }
 
        public List<Item> inspireRewards { get; private set; }
 
        public event Action allianceBossStateRefresh;
 
        public override void Init()
        {
            ParseConfig();
        }
 
        public void OnBeforePlayerDataInitialize()
        {
            isActivityOver = false;
        }
 
        public void OnPlayerLoginOk()
        {
        }
 
        public override void UnInit()
        {
        }
 
        void ParseConfig()
        {
            var config = FuncConfigConfig.Get("LeagueBOSSNumber1");
            participateLimit = int.Parse(config.Numerical1);
 
            inspireRewards = new List<Item>();
            config = FuncConfigConfig.Get("LeagueBOSSReward1");
            var itemArray = LitJson.JsonMapper.ToObject<int[][]>(config.Numerical1);
            for (int i = 0; i < itemArray.Length; i++)
            {
                var item = itemArray[i];
                inspireRewards.Add(new Item()
                {
                    id = item[0],
                    count = item[1],
                });
            }
        }
 
        public void ReceivePackage(HA40C_tagGCAllFamilyBossInfo package)
        {
            isActivityOver = package.IsEnd == 1;
            if (allianceBossStateRefresh != null)
            {
                allianceBossStateRefresh();
            }
        }
    }
}