少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using vnxbqy.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
 
class PetHorseAwakingData
{
 
    Redpoint redpoint;
 
    static int RedpointIndex = 0;
 
    int type, id, level, exp, maxLevel, skinIdex;
    int _index = 1;
 
    Dictionary<int, int> skinLevels = new Dictionary<int, int>();
 
    public int Id { get { return id; } }
 
    public int SkinIdex { get { return skinIdex; } set { skinIdex = value; } }
 
    public int Type { get { return type; } }
 
    public int Level { get { return level; } set { level = value; } }
 
    public int Exp { get { return exp; } set { exp = value; } }
 
    public Redpoint Redpoint { get { return redpoint; } }
 
    public bool IsMaxLevel { get { return this.level >= this.maxLevel; } }
 
    public Dictionary<int, int> SkinLevels { get { return skinLevels; } }
 
    public PetHorseAwakingData(int redpointId)
    {
        redpoint = new Redpoint(redpointId, redpointId * 1000 + RedpointIndex);
        RedpointIndex++;
    }
 
    public void Parse(ILPetHorseAwakingConfig config)
    {
        this.type = config.Type;
        this.id = config.ID;
        if (config.SkinLV > this.maxLevel)
            this.maxLevel = config.SkinLV;
 
        if (config.SkinIndex > 0)
        {
            this.skinLevels[this._index] = config.SkinLV;
            this._index++;
        }
    }
 
    public int GetDefaultSelectSkinLevel()
    {
        if (this.skinLevels.Count == 0)
            return 0;
 
        if (this.skinIdex > 0)
            return this.skinLevels[this.skinIdex];
 
        return this.skinLevels[1];
    }
 
    public int GetIndexByLevel(int level)
    {
        var keyList = skinLevels.Keys.ToList();
        for (int i = 0; i < keyList.Count; i++)
        {
            if (skinLevels[keyList[i]] == level)
                return keyList[i];
        }
        return 0;
    }
 
    public void Reset()
    {
        level = 0;
        exp = 0;
        skinIdex = 0;
    }
 
 
}