예제 #1
0
        public void FindCollectionOf_ReturnsInnerResult()
        {
            mockInnerSelector
            .Setup(s => s.FindCollectionOf("my table", "my entry", "collection 1", "collection 2"))
            .Returns("my collection");

            var result = proxy.FindCollectionOf("my table", "my entry", "collection 1", "collection 2");

            Assert.That(result, Is.EqualTo("my collection"));
        }
예제 #2
0
        private string GetRodName(string itemName)
        {
            var rods = RodConstants.GetAllRods();

            if (rods.Contains(itemName))
            {
                return(itemName);
            }

            var rodFromBaseName = collectionsSelector.FindCollectionOf(TableNameConstants.Collections.Set.ItemGroups, itemName, rods.ToArray());

            return(rodFromBaseName);
        }
예제 #3
0
        private string GetStaffName(string itemName)
        {
            var staffs = StaffConstants.GetAllStaffs();

            if (staffs.Contains(itemName))
            {
                return(itemName);
            }

            var staffFromBaseName = collectionsSelector.FindCollectionOf(TableNameConstants.Collections.Set.ItemGroups, itemName, staffs.ToArray());

            return(staffFromBaseName);
        }
예제 #4
0
        public int GenerateBaseAttackBonus(CreatureType creatureType, HitPoints hitPoints)
        {
            if (hitPoints.RoundedHitDiceQuantity == 0)
            {
                return(0);
            }

            var baseAttackQuality = collectionSelector.FindCollectionOf(TableNameConstants.Collection.CreatureGroups, creatureType.Name, GroupConstants.GoodBaseAttack, GroupConstants.AverageBaseAttack, GroupConstants.PoorBaseAttack);

            switch (baseAttackQuality)
            {
            case GroupConstants.GoodBaseAttack: return(GetGoodBaseAttackBonus(hitPoints.RoundedHitDiceQuantity));

            case GroupConstants.AverageBaseAttack: return(GetAverageBaseAttackBonus(hitPoints.RoundedHitDiceQuantity));

            case GroupConstants.PoorBaseAttack: return(GetPoorBaseAttackBonus(hitPoints.RoundedHitDiceQuantity));

            default: throw new ArgumentException($"{creatureType.Name} has no base attack");
            }
        }
 public string FindCollectionOf(string tableName, string entry, params string[] filteredCollectionNames)
 {
     return(innerSelector.FindCollectionOf(tableName, entry, filteredCollectionNames));
 }
예제 #6
0
        public void FindCollectionOfNameFromTable()
        {
            var collectionName = collectionsSelector.FindCollectionOf("CollectionTable", "entry 3", "collection", "sub-collection");

            Assert.That(collectionName, Is.EqualTo("collection"));
        }