看 rv 增加的金币 times+1
This commit is contained in:
parent
02d6712928
commit
7fff655e81
|
|
@ -69,11 +69,14 @@ object AccountManager {
|
|||
return mAccount.rvTimesGold
|
||||
}
|
||||
|
||||
fun adjustGold(adjustNum: Long, recordBean: RecordGold): Boolean {
|
||||
fun adjustGold(adjustNum: Long, recordBean: RecordGold, isEarnByRv: Boolean = false): Boolean {
|
||||
if (adjustNum < 0L && Math.abs(adjustNum) > getGold()) {
|
||||
return false
|
||||
}
|
||||
mAccount.goldCount += adjustNum
|
||||
if (isEarnByRv) {
|
||||
mAccount.rvTimesGold++
|
||||
}
|
||||
saveAccountInfo()
|
||||
NotifyMan.instance().sendEvent(VididinEvents.Event_Account_Gold_Changed, null)
|
||||
RecordsManager.instance().appendGoldRecord(recordBean)
|
||||
|
|
@ -95,11 +98,14 @@ object AccountManager {
|
|||
}
|
||||
|
||||
@Synchronized
|
||||
fun adjustCash(adjustNum: Double, recordBean: RecordCash? = null): Boolean {
|
||||
fun adjustCash(adjustNum: Double, recordBean: RecordCash? = null, isEarnByRv: Boolean = false): Boolean {
|
||||
if (adjustNum < 0L && Math.abs(adjustNum) > getCash()) {
|
||||
return false
|
||||
}
|
||||
mAccount.cashCount += adjustNum
|
||||
if (isEarnByRv) {
|
||||
mAccount.rvTimesCash++
|
||||
}
|
||||
saveAccountInfo()
|
||||
NotifyMan.instance().sendEvent(VididinEvents.Event_Account_Cash_Changed, null)
|
||||
recordBean?.let {
|
||||
|
|
@ -159,7 +165,7 @@ object AccountManager {
|
|||
if (getGold() >= costGoldNum) {
|
||||
adjustGold(-1L * costGoldNum.toInt(), RecordGold(RECORD_GOLD_MINUS_CONVERT_2_CASH, -1L * costGoldNum.toInt()))
|
||||
val adjustCashNum = couldCovertCashTotal * 0.1
|
||||
adjustCash(adjustCashNum, RecordCash(RECORD_CASH_PLUS_GOLD_CONVERT, adjustCashNum.toDouble()))
|
||||
adjustCash(adjustCashNum, RecordCash(RECORD_CASH_PLUS_GOLD_CONVERT, adjustCashNum.toDouble()), true)
|
||||
AndroidUtil.showCustomToast(String.format(ResUtil.getString(R.string.has_claim_box_cash_hint), adjustCashNum))
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class TaskManager private constructor() {
|
|||
|
||||
VididinEvents.EVENT_AD_WATCHED_FOR_EARN_GOLD -> {
|
||||
val goldNum = VidiConst.WATCH_AD_REWARD_GOLD.toLong()
|
||||
AccountManager.adjustGold(goldNum, RecordGold(RECORD_GOLD_PLUS_WATCH_REWARD_AD, goldNum))
|
||||
AccountManager.adjustGold(goldNum, RecordGold(RECORD_GOLD_PLUS_WATCH_REWARD_AD, goldNum), true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class DailySignTaskHelper : BaseTaskHelper<TaskDailySignBean, Task>() {
|
|||
daySignState.hasWatchedAd = isByAd
|
||||
saveState2Sp()
|
||||
val goldNum = finalReward.toLong()
|
||||
AccountManager.adjustGold(goldNum, RecordGold(RECORD_GOLD_PLUS_TASK_SIGN, goldNum))
|
||||
AccountManager.adjustGold(goldNum, RecordGold(RECORD_GOLD_PLUS_TASK_SIGN, goldNum), true)
|
||||
notifySignStateChanged(Pair(dayIndex, daySignState))
|
||||
|
||||
StatisticUtil.reportEvents(StatisticUtil.KEY_Daily_Sign, mapOf(
|
||||
|
|
|
|||
Loading…
Reference in New Issue