﻿using AutoMapper;
using SmallWorld.BusinessEntities.Football.Agents;
using SmallWorld.BusinessEntities.Football.Contests;
using SmallWorld.BusinessEntities.Football.Groups;
using SmallWorld.BusinessEntities.Football.Representations;
using SmallWorld.BusinessEntities.Football.Venues;
using SmallWorld.Core;
using SmallWorld.Domain.Interfaces.Football.Factories;
using SmallWorld.Dtos;
using SmallWorld.Dtos.Actions;
using SmallWorld.Dtos.Football;

namespace SmallWorld.Domain.Football.Factories
{
    public class DomainMapperFactory: IDomainMapperFactory
    {
        public IMapper Create()
        {
            var config = new MapperConfiguration(cfg => {
                cfg.CreateMap<Coordinate, CoordinateDto>();
                cfg.CreateMap<FootballPlayer, FootballPlayerDto>();
                cfg.CreateMap<FootballTeam, FootballTeamDto>();
                    //.ForMember(dest => dest.Players, opt => opt.MapFrom(source => source.Players));
                cfg.CreateMap<Playfield, PlayfieldDto>();
                cfg.CreateMap<FootballFrame, FootballFrameDto>();
                cfg.CreateMap<Ball, BallDto>();
                cfg.CreateMap<StartFootballMatchDto, FootballMatch>();
            });

            return config.CreateMapper();
        }
    }
}
