private List <MonstersData> selectMTypes(PackTypes packType) { List <MonstersData> mData = new List <MonstersData>(); if (packType == PackTypes.Fighters || packType == PackTypes.Casters) { foreach (MonstersData data in monstersDataList) { if (data.monsterParameters["mType"].Equals(packType.ToString())) { mData.Add(data); } } } else if (packType == PackTypes.Balanced || packType == PackTypes.CastersSupFighters || packType == PackTypes.FightersSupCasters) { foreach (MonstersData data in monstersDataList) { mData.Add(data); } } else if (packType == PackTypes.Boss) { } //remove wrong ranks checkMranks(mData, packType); return(mData); }
public void Can_Create_Pack_Custom_6Cards() { //PackSingleType - тип заранее определенный PreDefinedType var typeContainer = new PackTypes <PackSingleType>(); typeContainer.RemoveAllPackType();//очищаем typeContainer.AddPackType( definitionOfPack: PackTypeVariations.custom, minValue: (int)CardValue.Nine, maxValue: (int)CardValue.Ten, maxSuit: 3 ); var availableTypes = typeContainer.GetAllPackTypes().ToList(); var cardSuitCount = typeContainer.GetAvailableCardSuits(availableTypes[0]).Count(); var cardNameCount = typeContainer.GetAvailableCardValues(availableTypes[0]).Count(); var totalCardInPack = cardSuitCount * cardNameCount; Assert.AreEqual(1, availableTypes.Count); Assert.AreEqual(3, cardSuitCount); Assert.AreEqual(2, cardNameCount); Assert.AreEqual(6, totalCardInPack); }
public void getPack(int packCost, PackTypes packType ) { List <MonstersData> selectedMTypes = selectMTypes(packType); generatedPack = generatePack(packCost, selectedMTypes, packType); }
public int GetPackId(PackTypes type) { if (this.gameCode == "BTGJ") { if (type == PackTypes.FileData) { return(0x01); } if (type == PackTypes.ProjectTable) { return(0x04); } if (type == PackTypes.ProjectData) { return(0x05); } } else if (this.gameCode == "TENJ") { if (type == PackTypes.FileData) { return(0x05); } if (type == PackTypes.ProjectTable) { return(0x0C); } if (type == PackTypes.ProjectData) { return(0x0D); } } return(-1); }
private void checkMranks(List <MonstersData> mData, PackTypes packType) { switch (packType) { case PackTypes.Fighters: { removeRanks(new int[] { 2, 3 }, mData); break; } case PackTypes.Casters: { removeRanks(new int[] { 2, 3 }, mData); break; } case PackTypes.Balanced: { removeRanks(new int[] { 2, 3 }, mData); break; } case PackTypes.FightersSupCasters: { removeRanks(new int[] { 2, 3 }, mData); break; } case PackTypes.CastersSupFighters: { removeRanks(new int[] { 2, 3 }, mData); break; } } }
private diversityValues getDiversityValues(PackTypes packType) { switch (packType) { case PackTypes.Fighters: { return(new diversityValues(100, 0, 0, 0, 0, 0)); } case PackTypes.Casters: { return(new diversityValues(0, 0, 0, 100, 0, 0)); } case PackTypes.Balanced: { return(new diversityValues(50, 0, 0, 50, 0, 0)); } case PackTypes.FightersSupCasters: { return(new diversityValues(80, 0, 0, 20, 0, 0)); } case PackTypes.CastersSupFighters: { return(new diversityValues(20, 0, 0, 80, 0, 0)); } default: return(new diversityValues(0, 0, 0, 0, 0, 0)); } }
public int GetPackId(PackTypes type) { if (this.gameCode == "BTGJ") { if (type == PackTypes.FileData) return 0x01; if (type == PackTypes.ProjectTable) return 0x04; if (type == PackTypes.ProjectData) return 0x05; } else if (this.gameCode == "TENJ") { if (type == PackTypes.FileData) return 0x05; if (type == PackTypes.ProjectTable) return 0x0C; if (type == PackTypes.ProjectData) return 0x0D; } return -1; }
private List <A_Monster> generatePack(int packCost, List <MonstersData> selectedMTypes, PackTypes packType) { List <A_Monster> generatedMonsters = new List <A_Monster>(); diversityValues divValues = getDiversityValues(packType); diversityValues actualCostValues = new diversityValues( getSubPackCost(packCost, divValues.fightersR1), getSubPackCost(packCost, divValues.fightersR2), getSubPackCost(packCost, divValues.fightersR3), getSubPackCost(packCost, divValues.castersR1), getSubPackCost(packCost, divValues.castersR2), getSubPackCost(packCost, divValues.castersR3)); int[] costValuesArray = new int[6] { actualCostValues.fightersR1, actualCostValues.fightersR2, actualCostValues.fightersR3, actualCostValues.castersR1, actualCostValues.castersR2, actualCostValues.castersR3 }; for (int i = 0; i < costValuesArray.Length; ++i) { if (costValuesArray[i] > 0) { generateToCost(i, costValuesArray[i], selectedMTypes, generatedMonsters); } } return(generatedMonsters); }