Пример #1
0
    public void TestAussehen()
    {
        var races = Enum.GetValues(typeof(Races));

        try {
            foreach (Races race in races)
            {
                mCharacter.Spezies = race;
                CharacterEngine.ComputeErscheinung(this.mCharacter);
                switch (mCharacter.Spezies)
                {
                case Races.Mensch:
                case Races.Halbling:
                    Assert.LessOrEqual(mCharacter.Aussehen, _MAX_AU, "Mensch zu schön");
                    break;

                case Races.Elf:
                    Assert.GreaterOrEqual(mCharacter.Aussehen, _MIN_AU_ELF, "Elf zu hässlich");
                    break;

                case Races.Berggnom:
                case Races.Waldgnom:
                case Races.Zwerg:
                    Assert.LessOrEqual(mCharacter.Aussehen, _MAX_AU_GNOM, "Gnom oder Zwerg zu hübsch");
                    break;

                default:
                    break;
                }
            }
        } catch (AssertionException aEx) {
            Debug.Log(aEx.ToString());
            Assert.Fail();
        }
    }
Пример #2
0
    public void TestGewicht()
    {
        var races = Enum.GetValues(typeof(Races));

        try {
            foreach (Races race in races)
            {
                mCharacter.Spezies = race;
                CharacterEngine.ComputeBasisSt(mCharacter);
                CharacterEngine.ComputeErscheinung(this.mCharacter);
                switch (mCharacter.Spezies)
                {
                case Races.Mensch:
                    if (mCharacter.Sex == Geschlecht.Mann)
                    {
                        Assert.GreaterOrEqual(mCharacter.Gewicht, _MIN_GEWICHT_MANN, "Mann zu dünn!");
                        Assert.LessOrEqual(mCharacter.Gewicht, _MAX_GEWICHT_MANN, "Mann zu dick!");
                    }
                    else
                    {
                        Assert.GreaterOrEqual(mCharacter.Gewicht, _MIN_GEWICHT_FRAU, "Frau zu dünn!");
                        Assert.LessOrEqual(mCharacter.Gewicht, _MAX_GEWICHT_FRAU, "Frau zu dick!");
                    }
                    break;

                case Races.Elf:
                    Assert.GreaterOrEqual(mCharacter.Gewicht, _MIN_GEWICHT_ELF, "Elf zu dünn");
                    Assert.LessOrEqual(mCharacter.Gewicht, _MAX_GEWICHT_ELF, "Elf zu dick");
                    break;

                case Races.Berggnom:
                case Races.Waldgnom:
                    Assert.GreaterOrEqual(mCharacter.Gewicht, _MIN_GEWICHT_GNOM, "Gnom zu dünn");
                    Assert.LessOrEqual(mCharacter.Gewicht, _MAX_GEWICHT_GNOM, "Gnom zu dick");
                    break;

                case Races.Halbling:
                    Assert.GreaterOrEqual(mCharacter.Gewicht, _MIN_GEWICHT_HALBLING, "Halbling zu dünn");
                    Assert.LessOrEqual(mCharacter.Gewicht, _MAX_GEWICHT_HALBLING, "Halbling zu dick");
                    break;

                case Races.Zwerg:
                    Assert.GreaterOrEqual(mCharacter.Gewicht, _MIN_GEWICHT_ZWERG, "Zwerg zu dünn: ");
                    Assert.LessOrEqual(mCharacter.Gewicht, _MAX_GEWICHT_ZWERG, "Zwerg zu dick");
                    break;

                default:
                    break;
                }
            }
        } catch (AssertionException aEx) {
            Debug.Log(aEx.ToString());
            Assert.Fail();
        }
    }
    public void TestPersönlicheAusstrahlung()
    {
        mCharacter.Spezies  = Races.Mensch;
        mCharacter.Archetyp = AbenteuerTyp.BN;         //egal
        CharacterEngine.ComputeBasisIn(this.mCharacter);
        CharacterEngine.ComputeErscheinung(this.mCharacter);
        CharacterEngine.ComputePsychisch(this.mCharacter);

        Assert.GreaterOrEqual(mCharacter.pA, _MIN_D100);
        Assert.LessOrEqual(mCharacter.pA, _MAX_D100);
    }
    // Use this for initialization
    public void SetErscheinungCompute()
    {
        Toolbox globalVars = Toolbox.Instance;

        //Berechne-> und speicher in Charakter
        CharacterEngine.ComputeErscheinung(globalVars.mCharacter);

        inB.text        = globalVars.mCharacter.B.ToString();
        inGroesse.text  = globalVars.mCharacter.Groesse.ToString();
        inGewicht.text  = globalVars.mCharacter.Gewicht.ToString();
        inAussehen.text = globalVars.mCharacter.Aussehen.ToString();


        Debug.Log(globalVars.mCharacter.ToString());
    }
Пример #5
0
    public void TestePAMenschForAllATypen()
    {
        _mCharacter.Spezies = Races.Mensch;
        var aTypen = Enum.GetValues(typeof(AbenteuerTyp));

        try {
            foreach (AbenteuerTyp aTyp in aTypen)
            {
                _mCharacter.Archetyp = aTyp;
                CharacterEngine.ComputeBasisIn(this._mCharacter);
                CharacterEngine.ComputeErscheinung(this._mCharacter);
                CharacterEngine.ComputePsychisch(this._mCharacter);                  //enthält pA!!
                int pA = _mCharacter.pA;

                switch (_mCharacter.Archetyp)
                {
                case AbenteuerTyp.Hä:
                    Assert.GreaterOrEqual(pA, this._HAE_PA, "Händler pA zu gering, pA:" + pA);
                    break;

                case AbenteuerTyp.Gl:
                    Assert.GreaterOrEqual(pA, this._GL_PA, "Glücksritter pA zu gering , pA:" + pA);
                    break;

                case AbenteuerTyp.Ba:
                    Assert.GreaterOrEqual(pA, this._BA_PA, "Barde pA zu gering, pA:" + pA);
                    break;

                case AbenteuerTyp.Tm:
                    Assert.GreaterOrEqual(pA, this._TM_PA, "Tiermeister pA zu gering, pA:" + pA);
                    break;

                default:
                    break;
                }
            }
        } catch (AssertionException asEx) {
            Debug.Log(asEx.ToString());
            Assert.Fail();
        }
    }
Пример #6
0
    public void TestBewegungsweite()
    {
        var races = Enum.GetValues(typeof(Races));

        try {
            foreach (Races race in races)
            {
                mCharacter.Spezies = race;
                CharacterEngine.ComputeErscheinung(this.mCharacter);
                switch (mCharacter.Spezies)
                {
                case Races.Mensch:
                    Assert.GreaterOrEqual(mCharacter.B, _MIN_B, "Mensch oder Elf zu langsam");
                    break;

                case Races.Elf:
                    Assert.LessOrEqual(mCharacter.B, _MAX_B, "Mensch oder elf zu schnell");
                    break;

                case Races.Berggnom:
                case Races.Waldgnom:
                case Races.Halbling:
                    Assert.GreaterOrEqual(mCharacter.B, _MIN_B_GNOME, "Gnome oder Halbling zu langsam");
                    Assert.LessOrEqual(mCharacter.B, _MAX_B_GNOME, "Gnome oder Halbling zu schnell");
                    break;

                case Races.Zwerg:
                    Assert.GreaterOrEqual(mCharacter.B, _MIN_B_ZWERG, "Zwerg zu langsam");
                    Assert.LessOrEqual(mCharacter.B, _MAX_B_ZWERG, "Zwerg zu schnell");
                    break;

                default:
                    break;
                }
            }
        } catch (AssertionException aEx) {
            Debug.Log(aEx.ToString());
            Assert.Fail();
        }
    }