using ActionGame.GameResources.Models;
using ActionGame.GameResources.Repository;
using ActionGame.RawResources.Manager;


namespace ActionGame.GameResources.Manager
{
    public class DefaultGameContentManager : IGameContentManager
    {
        public IGameContentRepository<TileSet> TileSetRepository { get; private set; }
        public IGameContentRepository<CharacterSet> CharacterSetRepository { get; private set; }
        public IGameContentRepository<WorldMap> WorldMapRepository { get; private set; }
        public IGameContentRepository<PlayerDefinition> PlayerDefinition { get; private set; }
        public IGameContentRepository<ItemDefinition> ItemDefinitionRepository { get; private set; }
        public IGameContentRepository<EnemyDefinition> EnemyDefinitionRepository { get; private set; }


        public DefaultGameContentManager(IRawContentManager rawContentManager)
        {
            //1st pass
            this.TileSetRepository = new FileTileSetRepository(rawContentManager, "tilesets.csv");
            this.CharacterSetRepository = new FileCharacterSetRepository(rawContentManager, "charactersets.csv");

            //2nd pass
            this.PlayerDefinition = new FilePlayerDefinitionRepository("player.csv");
            this.ItemDefinitionRepository = new FileItemDefinitionRepository("items.csv");
            this.EnemyDefinitionRepository = new FileEnemyDefinitionRepository("enemies.csv");

            //3rd pass
            this.WorldMapRepository = new FileWorldMapRepository(this, "worldmaps.csv");
        }

    }
}

