Skip to content

Commit 8196c0e

Browse files
committed
deps: Updated the dependencies
1 parent a7ebcef commit 8196c0e

3 files changed

Lines changed: 58 additions & 10 deletions

File tree

DataAccess/DataObjects/BoardEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Collections.Generic;
22

3-
using NuciXNA.DataAccess.DataObjects;
3+
using NuciDAL.DataObjects;
44
using NuciXNA.Primitives;
55

66
namespace SokoGrump.DataAccess.DataObjects

DataAccess/Repositories/BoardRepository.cs

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using System.Linq;
45
using System.Xml.Serialization;
56

6-
using NuciXNA.DataAccess.Repositories;
7+
using NuciDAL.Repositories;
78

89
using SokoGrump.DataAccess.DataObjects;
910
using SokoGrump.Settings;
@@ -17,6 +18,8 @@ public class BoardRepository : IRepository<string, BoardEntity>
1718
{
1819
readonly string boardsDirectory;
1920

21+
public int EntitiesCount => GetAll().Count();
22+
2023
/// <summary>
2124
/// Initializes a new instance of the <see cref="BoardRepository"/> class.
2225
/// </summary>
@@ -36,6 +39,10 @@ public void Add(BoardEntity boardEntity)
3639
throw new NotImplementedException();
3740
}
3841

42+
public void TryAdd(BoardEntity boardEntity) { }
43+
44+
public bool ContainsId(string id) => TryGet(id) is not null;
45+
3946
/// <summary>
4047
/// Get the board with the specified identifier.
4148
/// </summary>
@@ -90,6 +97,18 @@ public BoardEntity Get(string id)
9097
return boardEntity;
9198
}
9299

100+
public BoardEntity TryGet(string id)
101+
{
102+
try
103+
{
104+
return Get(id);
105+
}
106+
catch
107+
{
108+
return null;
109+
}
110+
}
111+
93112
/// <summary>
94113
/// Gets all the boards.
95114
/// </summary>
@@ -127,6 +146,15 @@ public void Update(BoardEntity boardEntity)
127146
// TODO: Save the ProvinceMap and TerrainMap as well
128147
}
129148

149+
public void TryUpdate(BoardEntity boardEntity)
150+
{
151+
try
152+
{
153+
Update(boardEntity);
154+
}
155+
catch { }
156+
}
157+
130158
/// <summary>
131159
/// Removes the board with the specified identifier.
132160
/// </summary>
@@ -136,6 +164,15 @@ public void Remove(string id)
136164
Directory.Delete(Path.Combine(boardsDirectory, id));
137165
}
138166

167+
public void TryRemove(string id)
168+
{
169+
try
170+
{
171+
Remove(id);
172+
}
173+
catch { }
174+
}
175+
139176
/// <summary>
140177
/// Removes the specified board.
141178
/// </summary>
@@ -145,6 +182,17 @@ public void Remove(BoardEntity boardEntity)
145182
Remove(boardEntity.Id);
146183
}
147184

185+
public void TryRemove(BoardEntity boardEntity)
186+
{
187+
try
188+
{
189+
Remove(boardEntity);
190+
}
191+
catch { }
192+
}
193+
194+
public void ApplyChanges() { }
195+
148196
Dictionary<int, TileEntity> GetTileEntities()
149197
{
150198
Dictionary<int, TileEntity> tiles = new Dictionary<int, TileEntity>();

SokoGrump.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
17-
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.1.303" />
18-
<PackageReference Include="NuciXNA.DataAccess" Version="2.0.0" />
19-
<PackageReference Include="NuciXNA.Graphics" Version="2.0.0" />
20-
<PackageReference Include="NuciXNA.Gui" Version="3.0.0" />
21-
<PackageReference Include="NuciXNA.Input" Version="2.0.0" />
22-
<PackageReference Include="NuciXNA.Primitives" Version="2.0.0" />
23-
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
16+
<PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.4" />
17+
<PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.4" />
18+
<PackageReference Include="NuciDAL" Version="2.2.1" />
19+
<PackageReference Include="NuciXNA.DataAccess" Version="3.0.3" />
20+
<PackageReference Include="NuciXNA.Graphics" Version="2.1.1" />
21+
<PackageReference Include="NuciXNA.Gui" Version="3.0.1" />
22+
<PackageReference Include="NuciXNA.Input" Version="2.0.1" />
23+
<PackageReference Include="NuciXNA.Primitives" Version="2.1.1" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
 (0)