package be.naaturel.boardmateapi.controllers.mappings;

import be.naaturel.boardmateapi.common.models.Game;
import be.naaturel.boardmateapi.controllers.dtos.GameDto;


public class GameMapper {

    public static Game toModel(GameDto dto){
        return new Game(dto.getWhiteName(), dto.getBlackName(), dto.getTimeValue(), dto.getIncrement());
    }

    public static GameDto toDto(Game model){
        GameDto g = new GameDto();
        g.setWhiteName(model.getWhiteName());
        g.setBlackName(model.getBlackName());
        g.setTimeValue(model.getTimeValue());
        g.setIncrement(model.getIncrement());
        return g;
    }

}
