37 lines
945 B
C#
37 lines
945 B
C#
using GameData.Model;
|
|
using GameModel;
|
|
using GameModel.Contracts;
|
|
using Microsoft.Extensions.Logging;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GameData.Repository
|
|
{
|
|
public class GameRepository : IGameRepository
|
|
{
|
|
readonly ILogger<GameRepository> _log;
|
|
private ApiClient _client;
|
|
|
|
string Url => "items/gamestate";
|
|
public GameRepository(ILogger<GameRepository> log, ApiClient apiClient)
|
|
{
|
|
_log = log;
|
|
_client = apiClient;
|
|
}
|
|
|
|
public GameState Load(Guid gameId)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void Save(GameState gameState)
|
|
{
|
|
var gameStateDo = new GameStateDo(gameState.Id, gameState.GameId, gameState.GameName, gameState);
|
|
_client.Post<GameStateDo>(gameStateDo,Url);
|
|
}
|
|
}
|
|
}
|