public void Deselect(string socketId) { ArmorSelection armorSelection = GetArmorSelection(socketId); armorSelection.Selected = false; _context.SaveChanges(); Console.WriteLine("=============================================== " + "deactivate armor -> " + armorSelection.Selected); }
private void CreateArmorSelection(string socketId) { ArmorSelection temp = new ArmorSelection(); temp.SocketId = socketId; temp.Selected = true; temp.ArmorSize = 6; _context.ArmorSelections.Add(temp); _context.SaveChanges(); }
public int GetArmorCount(string socketId) { ArmorSelection armor = GetArmorSelection(socketId); if (armor != null) { return(armor.ArmorSize); } return(0); }
public ArmorSelection Select(string name) { var data = innerSelector.SelectFrom(TableNameConstants.Collections.Set.ArmorData, name).ToArray(); var selection = new ArmorSelection(); selection.ArmorBonus = Convert.ToInt32(data[DataIndexConstants.Armor.ArmorBonus]); selection.ArmorCheckPenalty = Convert.ToInt32(data[DataIndexConstants.Armor.ArmorCheckPenalty]); selection.MaxDexterityBonus = Convert.ToInt32(data[DataIndexConstants.Armor.MaxDexterityBonus]); return(selection); }
public bool IsArmorSelected(string socketId) { ArmorSelection armorSelection = GetArmorSelection(socketId); if (armorSelection != null) { if (armorSelection.Selected == true) { return(true); } } return(false); }
public void Setup() { mockPercentileSelector = new Mock <ITreasurePercentileSelector>(); mockCollectionsSelector = new Mock <ICollectionSelector>(); mockArmorDataSelector = new Mock <IArmorDataSelector>(); mundaneArmorGenerator = new MundaneArmorGenerator(mockPercentileSelector.Object, mockCollectionsSelector.Object, mockArmorDataSelector.Object); itemVerifier = new ItemVerifier(); armorSelection = new ArmorSelection(); mockPercentileSelector.Setup(s => s.SelectFrom(TableNameConstants.Percentiles.Set.MundaneArmors)).Returns("armor type"); mockArmorDataSelector.Setup(s => s.Select("armor type")).Returns(armorSelection); mockPercentileSelector.Setup(p => p.SelectFrom(TableNameConstants.Percentiles.Set.MundaneGearSizes)).Returns("size"); }
public void AddArmorSelection(string socketId) { ArmorSelection armorSelection = GetArmorSelection(socketId); if (armorSelection == null) { Console.WriteLine("=============================================== " + "create new armor"); CreateArmorSelection(socketId); } else { armorSelection.Selected = true; _context.SaveChanges(); Console.WriteLine("=============================================== " + "activate armor -> " + armorSelection.Selected); } }
public bool ArmorUp(int x, int y, int arenaId, string socketId) { ArmorSelection armorSelection = GetArmorSelection(socketId); Cell cell = ReturnCell(x, y, arenaId); if (cell != null) { if (cell.IsArmored == false && armorSelection.ArmorSize >= 1) { //cell.IsArmored = true; ArmorDecorator decorator = new ArmorDecorator(cell); decorator.AddArmor(); armorSelection.ArmorSize--; _context.SaveChanges(); return(true); } } return(false); }