Ejemplo n.º 1
0
    void NextHero()
    {
        hero = characterFactory.Next(heroRecipe);
        Debug.Log($"Spawned {hero.Name}. HP {hero.Stats_Total.MaxHp}, Attack {hero.Stats_Total.Strength}, Attack rate {hero.Stats_Total.AttackRate}");

        battleUI.SetHero(hero);
        battleUI.HeroAppears();

        heroDeathSub = hero.CurrentHP
                       .Where(x => x <= 0)
                       .Subscribe(_ =>
        {
            Debug.Log($"{hero.Name} fell in exhaustion. Enemy escaped.");
            fightController.StopFight();
            battleUI.HeroFell();
            battleUI.EnemyEscaped();
            Rest();
        });
    }
Ejemplo n.º 2
0
    public void CreateCharacter()
    {
        ICharacterFactory factory   = Container.Resolve <ICharacterFactory>();
        string            name      = "TestName";
        Stats             stats     = Container.Resolve <Stats>();
        ICharacter        character = factory.Next(name, stats);

        Assert.That(character.Name.Equals(name));
        Assert.That(character.Stats_Base.Strength == stats.Strength);
    }