using System;

namespace Nox.Game {
    public static class CharacterSystemsFactory {
        public static ICharacterSystems Create(
            PartySettings partySettings,
            StarterCharacterSettings starterCharacterSettings,
            PerksRegistry perksRegistry,
            CharacterRegistry characterRegistry,
            ModifiersRegistry modifiersRegistry) {
            IPerkFactory perkFactory = new PerkFactory(perksRegistry);
            IModifiersFactory modifiersFactory = new ModifiersFactory(modifiersRegistry);
            IModifierResolver modifierResolver = new ModifierResolver();
            ICharacterAttributesFactory attributesFactory = new CharacterAttributesFactory(modifierResolver);
            ICharacterStatsFactory statsFactory = new CharacterStatsFactory(starterCharacterSettings, modifierResolver);
            ICharacterFactory characterFactory = new CharacterFactory(attributesFactory, statsFactory, perkFactory, modifiersFactory);
            IPartyFactory partyFactory = new PartyFactory(partySettings, starterCharacterSettings);

            return new CharacterSystems(perkFactory, modifiersFactory, modifierResolver, characterFactory, partyFactory);
        }
    }
}
