示例#1
0
        public void LoadData()
        {
            SqliteDataReader reader = LocalDatabase.Instance.ReadFullTable("lobbylevel");

            data = new List <PeLobbyLevel>();
            while (reader.Read())
            {
                PeLobbyLevel lobbyLevel = new PeLobbyLevel();
                lobbyLevel.level   = Convert.ToInt32(reader.GetString(reader.GetOrdinal("level")));
                lobbyLevel.exp     = Convert.ToInt32(reader.GetString(reader.GetOrdinal("exp")));
                lobbyLevel.nextExp = Convert.ToInt32(reader.GetString(reader.GetOrdinal("next")));
                data.Add(lobbyLevel);
            }

            data.Sort(delegate(PeLobbyLevel x, PeLobbyLevel y) {
                if (x.level == y.level)
                {
                    return(0);
                }
                else if (x.level > y.level)
                {
                    return(1);
                }
                else
                {
                    return(-1);
                }
            });
        }
 void ResetLevel()
 {
     lobbyLevel       = PeLobbyLevel.Mgr.Instance.GetLevel(mRoleInfo.lobbyExp);
     mLbPlayerLv.text = (lobbyLevel != null) ? lobbyLevel.level.ToString() : "0";
 }