Ejemplo n.º 1
0
 public string GetNewBgmId()
 {
     _lastNameId = Base36IncrementHelper.ToString(Base36IncrementHelper.ToInt(_lastNameId) + 1);
     if (_lastNameId == "random")
     {
         return(GetNewBgmId());
     }
     return(_lastNameId);
 }
        private string GetNewBgmId()
        {
            var paramBgmDatabase = _state.LoadResource <PrcUiBgmDatabase>(Constants.GameResources.PRC_UI_BGM_DB_PATH);
            var lastNameId       = paramBgmDatabase.DbRootEntries.Values.Where(p => p.NameId != "random" && !string.IsNullOrEmpty(p.NameId)).OrderByDescending(p => Base36IncrementHelper.ToInt(p.NameId)).FirstOrDefault()?.NameId;

            lastNameId = Base36IncrementHelper.ToString(Base36IncrementHelper.ToInt(lastNameId) + 1);
            if (lastNameId == "random")
            {
                return(GetNewBgmId());
            }
            return(lastNameId);
        }