|
|
@ -3,6 +3,7 @@ using Shared;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
@ -27,6 +28,11 @@ namespace Stub
|
|
|
|
public GamesManager(StubData parent)
|
|
|
|
public GamesManager(StubData parent)
|
|
|
|
=> this.parent = parent;
|
|
|
|
=> this.parent = parent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Func<Game, int, bool> filterById = (game, id) => game.Id.Equals(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Task<bool> AddCaseValueToPlayer(int idGame, int idPlayer, int value, int index)
|
|
|
|
public Task<bool> AddCaseValueToPlayer(int idGame, int idPlayer, int value, int index)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var game = parent.games.FirstOrDefault(g => g.Id == idGame);
|
|
|
|
var game = parent.games.FirstOrDefault(g => g.Id == idGame);
|
|
|
@ -109,6 +115,26 @@ namespace Stub
|
|
|
|
|
|
|
|
|
|
|
|
public Task<Game?> UpdateItem(Game? oldItem, Game? newItem)
|
|
|
|
public Task<Game?> UpdateItem(Game? oldItem, Game? newItem)
|
|
|
|
=> parent.games.UpdateItem(oldItem, newItem);
|
|
|
|
=> parent.games.UpdateItem(oldItem, newItem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*public Task<IEnumerable<Game?>> GetItemsById(int idPlayer)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var Task<>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var game in parent.games)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var player in game.Players)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (player.Id == idPlayer)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// return parent.games.GetItemsWithFilterAndOrdering<Game>(game => filterById(game, id), 0, 1);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|