private void SetPlayerCurrenciesInfo(List <Currency> currencies) { for (int i = 0; i < currencies.Count; i++) { PlayerCurrencyInfo currency = this.currencies.GetCurrency(currencies[i].currencyType); currency.currencyValue = currencies[i].currencyValue; } }
private void HandleRefreshCurrencyFeedback(byte[] data) { RefreshCurrencyS2C feedback = ProtobufUtils.Deserialize <RefreshCurrencyS2C>(data); if (feedback.result) { List <Currency> currenciesList = feedback.currencies; for (int i = 0; i < currenciesList.Count; i++) { CurrencyType type = currenciesList[i].currencyType; PlayerCurrencyInfo currency = GetCurrency(type); currency.currencyValue = currenciesList[i].currencyValue; } MessageDispatcher.PostMessage(Constants.MessageType.RefreshCurrency); } }