/// <summary> /// 获取弹幕游戏数据 /// </summary> /// <param name="itemPreData"></param> /// <param name="miniGameData"></param> private static void GetMiniGameDataForBarrage(PreTypeForMiniGameBean itemPreData, MiniGameBaseBean miniGameData) { if (miniGameData.gameType != MiniGameEnum.Barrage) { return; } MiniGameBarrageBean miniGameBarrage = (MiniGameBarrageBean)miniGameData; switch (itemPreData.dataType) { case PreTypeForMiniGameEnum.BarrageForLaunchInterval: miniGameBarrage.launchInterval = float.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.BarrageForLaunchSpeed: miniGameBarrage.launchSpeed = float.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.BarrageForLaunchTypes: MiniGameBarrageEjectorCpt.LaunchTypeEnum[] launchTypes = StringUtil.SplitBySubstringForArrayEnum <MiniGameBarrageEjectorCpt.LaunchTypeEnum>(itemPreData.data, ','); miniGameBarrage.launchTypes = launchTypes; break; case PreTypeForMiniGameEnum.BarrageForLaunchNumber: miniGameBarrage.launchNumber = int.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.BarrageForBulletType: miniGameBarrage.bulletType = (MiniGameBarrageBulletTypeEnum)(int.Parse(itemPreData.data)); break; } }
/// <summary> /// 获取战斗游戏数据 /// </summary> /// <param name="itemPreData"></param> /// <param name="miniGameData"></param> private static void GetMiniGameDataForCombat(PreTypeForMiniGameBean itemPreData, MiniGameBaseBean miniGameData) { if (miniGameData.gameType != MiniGameEnum.Combat) { return; } MiniGameCombatBean miniGameCombat = (MiniGameCombatBean)miniGameData; switch (itemPreData.dataType) { case PreTypeForMiniGameEnum.CombatForBringDownNumber: miniGameData.winBringDownNumber = int.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.CombatForSurvivalNumber: miniGameData.winSurvivalNumber = int.Parse(itemPreData.data); break; } }
/// <summary> /// 获取算账游戏游戏数据 /// </summary> /// <param name="itemPreData"></param> /// <param name="miniGameData"></param> private static void GetMiniGameDataForAccount(PreTypeForMiniGameBean itemPreData, MiniGameBaseBean miniGameData) { if (miniGameData.gameType != MiniGameEnum.Account) { return; } MiniGameAccountBean miniGameAccount = (MiniGameAccountBean)miniGameData; switch (itemPreData.dataType) { case PreTypeForMiniGameEnum.AccountForWinMoneyL: miniGameData.winMoneyL = int.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.AccountForWinMoneyM: miniGameData.winMoneyM = int.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.AccountForWinMoneyS: miniGameData.winMoneyS = int.Parse(itemPreData.data); break; } }
/// <summary> /// 获取烹饪游戏数据 /// </summary> /// <param name="itemPreData"></param> /// <param name="miniGameData"></param> private static void GetMiniGameDataForCook(PreTypeForMiniGameBean itemPreData, MiniGameBaseBean miniGameData) { if (miniGameData.gameType != MiniGameEnum.Cooking) { return; } MiniGameCookingBean miniGameCooking = (MiniGameCookingBean)miniGameData; //审核人员 List <CharacterBean> listAuditData = new List <CharacterBean>(); //主持人 List <CharacterBean> listCompereData = new List <CharacterBean>(); switch (itemPreData.dataType) { case PreTypeForMiniGameEnum.CookingForScore: miniGameData.winScore = int.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.CookingForStoryStartId: miniGameCooking.storyGameStartId = long.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.CookingForStoryAuditId: miniGameCooking.storyGameAuditId = long.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.CookingForAuditCharacter: long[] auditIds = StringUtil.SplitBySubstringForArrayLong(itemPreData.data, ','); listAuditData = NpcInfoHandler.Instance.manager.GetCharacterDataByIds(auditIds); //评审人员只有5位 listAuditData = RandomUtil.GetRandomDataByListForNumberNR(listAuditData, 5); //如果评审人员不够 就随机增加小镇人员 if (listAuditData.Count < 5) { int tempNumber = 5 - listAuditData.Count; List <CharacterBean> listTempCharacterData = NpcInfoHandler.Instance.manager.GetCharacterDataByType(NpcTypeEnum.Town); listAuditData.AddRange(RandomUtil.GetRandomDataByListForNumberNR(listTempCharacterData, tempNumber)); } break; case PreTypeForMiniGameEnum.CookingForCompereCharacter: long[] compereIds = StringUtil.SplitBySubstringForArrayLong(itemPreData.data, ','); listCompereData = NpcInfoHandler.Instance.manager.GetCharacterDataByIds(compereIds); break; case PreTypeForMiniGameEnum.CookingForThemeLevel: int[] themeLevels = StringUtil.SplitBySubstringForArrayInt(itemPreData.data, ','); miniGameCooking.cookingThemeLevel = RandomUtil.GetRandomDataByArray(themeLevels); break; case PreTypeForMiniGameEnum.CookingForThemeId: miniGameCooking.cookingThemeId = long.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.CookingForButtonNumber: miniGameCooking.cookButtonNumber = int.Parse(itemPreData.data); break; case PreTypeForMiniGameEnum.CookingForWinRank: miniGameCooking.winRank = int.Parse(itemPreData.data); break; } miniGameCooking.InitData(null, null, listAuditData, listCompereData); }