public UIElement GetIncomeElement() { IncomeViewModel viewModel = new IncomeViewModel(facade); IncomeControl control = new IncomeControl(viewModel); return(control); }
public static uint GetLevelIncomeRuleID(SLevelContext _levelContext, IncomeControl inControl) { inControl.m_isExpCompensate = false; inControl.m_originalGoldCoinInBattle = 0; inControl.m_compensateRateList.Clear(); uint dwSoulID = 0; if ((_levelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_ADVENTURE) || (_levelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_GUIDE)) { ResLevelCfgInfo dataByKey = GameDataMgr.levelDatabin.GetDataByKey(_levelContext.iLevelID); return((dataByKey == null) ? 0 : dataByKey.dwSoulID); } if (((_levelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT) || (_levelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_MATCH)) || ((_levelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_ROOM) || (_levelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT))) { ResAcntBattleLevelInfo info2 = GameDataMgr.pvpLevelDatabin.GetDataByKey((uint)_levelContext.iLevelID); ResCounterPartLevelInfo info3 = null; if (info2 != null) { dwSoulID = info2.stLevelCommonInfo.dwSoulID; inControl.InitExpCompensateInfo(info2.stLevelCommonInfo.bIsOpenExpCompensate, ref info2.stLevelCommonInfo.astExpCompensateDetail); inControl.m_originalGoldCoinInBattle = info2.wOriginalGoldCoinInBattle; return(dwSoulID); } info3 = GameDataMgr.cpLevelDatabin.GetDataByKey((uint)_levelContext.iLevelID); if (info3 != null) { dwSoulID = info3.stLevelCommonInfo.dwSoulID; inControl.InitExpCompensateInfo(info3.stLevelCommonInfo.bIsOpenExpCompensate, ref info3.stLevelCommonInfo.astExpCompensateDetail); inControl.m_originalGoldCoinInBattle = info3.wOriginalGoldCoinInBattle; } return(dwSoulID); } if (_levelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER) { ResRankLevelInfo info4 = GameDataMgr.rankLevelDatabin.GetDataByKey((uint)_levelContext.iLevelID); dwSoulID = (info4 == null) ? 0 : info4.stLevelCommonInfo.dwSoulID; if (info4 != null) { inControl.InitExpCompensateInfo(info4.stLevelCommonInfo.bIsOpenExpCompensate, ref info4.stLevelCommonInfo.astExpCompensateDetail); inControl.m_originalGoldCoinInBattle = info4.wOriginalGoldCoinInBattle; } return(dwSoulID); } if (_levelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_REWARDMATCH) { ResRewardMatchLevelInfo info5 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey((uint)_levelContext.iLevelID); dwSoulID = (info5 == null) ? 0 : info5.stLevelCommonInfo.dwSoulID; if (info5 != null) { inControl.InitExpCompensateInfo(info5.stLevelCommonInfo.bIsOpenExpCompensate, ref info5.stLevelCommonInfo.astExpCompensateDetail); inControl.m_originalGoldCoinInBattle = info5.wOriginalGoldCoinInBattle; } return(dwSoulID); } if (_levelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_ACTIVITY) { ResLevelCfgInfo info6 = GameDataMgr.activityLevelDatabin.GetDataByKey(_levelContext.iLevelID); return((info6 == null) ? 0 : info6.dwSoulID); } if (_levelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_BURNING) { ResLevelCfgInfo info7 = GameDataMgr.burnMap.GetDataByKey(_levelContext.iLevelID); return((info7 == null) ? 0 : info7.dwSoulID); } if (_levelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_ARENA) { ResLevelCfgInfo info8 = GameDataMgr.burnMap.GetDataByKey(_levelContext.iLevelID); dwSoulID = (info8 == null) ? 0 : info8.dwSoulID; } return(dwSoulID); }