コード例 #1
0
    public void TestArmorName(EquipmentManager.EquipSlot slot, int armorRatingPosition)
    {
        ArmorItem armor = new ArmorItem(slot);

        double[] minArmor = new double[6];
        double[] maxArmor = new double[6];
        minArmor[armorRatingPosition] = 1;
        maxArmor[armorRatingPosition] = 5;

        double[] minSpeed = new double[6];
        double[] maxSpeed = new double[6];
        minSpeed[armorRatingPosition] = 1;
        maxSpeed[armorRatingPosition] = 5;

        double[] minDamage = new double[6];
        double[] maxDamage = new double[6];
        minDamage[armorRatingPosition] = 1;
        maxDamage[armorRatingPosition] = 5;

        string name = ItemSpawner.GenerateArmorName(5, armor, minArmor, maxArmor, minSpeed, maxSpeed, minDamage, maxDamage);
    }
コード例 #2
0
    public void TestArmorNameByRarity(EquipmentManager.EquipSlot slot, int armorRatingPosition, GameItem.ItemRarity rarity, string description)
    {
        ArmorItem armor = new ArmorItem(rarity, slot);

        double[] minArmor = new double[6];
        double[] maxArmor = new double[6];
        minArmor[armorRatingPosition] = 1;
        maxArmor[armorRatingPosition] = 5;

        double[] minSpeed = new double[6];
        double[] maxSpeed = new double[6];
        minSpeed[armorRatingPosition] = 1;
        maxSpeed[armorRatingPosition] = 5;

        double[] minDamage = new double[6];
        double[] maxDamage = new double[6];
        minDamage[armorRatingPosition] = 1;
        maxDamage[armorRatingPosition] = 5;

        string name = ItemSpawner.GenerateArmorName(5, armor, minArmor, maxArmor, minSpeed, maxSpeed, minDamage, maxDamage);

        string[] ssize = name.Split(null);
        Assert.AreEqual(ssize[0], description);
    }