少年修仙传客户端代码仓库
Client_PangDeRong
2018-09-21 d1a2ab5b56bae336a1b5cbc4f307cb67e76c22e6
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
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, August 09, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using System;
 
namespace Snxxz.UI {
 
    public class Equipment {
        public event Action levelUpEvent;
        public event Action starUpEvent;
 
        public int instanceId {
            get; private set;
        }
 
        public int configId {
            get; private set;
        }
 
        int m_Level = 0;
        public int level {
            get {
                return m_Level;
            }
            set {
                if(m_Level != value) {
                    m_Level = value;
                    if(levelUpEvent != null) {
                        levelUpEvent();
                    }
                }
            }
        }
 
        int m_Star = 0;
        public int star {
            get {
                return m_Star;
            }
            set {
                if(m_Star != value) {
                    m_Star = value;
                    if(starUpEvent != null) {
                        starUpEvent();
                    }
                }
            }
        }
 
 
        public Equipment(int _instanceId,int _configId) {
            this.instanceId = _instanceId;
            this.configId = _configId;
        }
 
        public static int Compare(Equipment _a,Equipment _b) {
            return _a.configId > _b.configId ? -1 : 1;
        }
 
    }
 
}