Example #1
0
        public void Deselect(string socketId)
        {
            ArmorSelection armorSelection = GetArmorSelection(socketId);

            armorSelection.Selected = false;
            _context.SaveChanges();
            Console.WriteLine("===============================================  " + "deactivate armor -> " + armorSelection.Selected);
        }
Example #2
0
        private void CreateArmorSelection(string socketId)
        {
            ArmorSelection temp = new ArmorSelection();

            temp.SocketId  = socketId;
            temp.Selected  = true;
            temp.ArmorSize = 6;
            _context.ArmorSelections.Add(temp);
            _context.SaveChanges();
        }
Example #3
0
        public int GetArmorCount(string socketId)
        {
            ArmorSelection armor = GetArmorSelection(socketId);

            if (armor != null)
            {
                return(armor.ArmorSize);
            }
            return(0);
        }
Example #4
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);
        }
Example #5
0
        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");
        }
Example #7
0
        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);
            }
        }
Example #8
0
        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);
        }