-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRubiksCubeState.cs
30 lines (27 loc) · 956 Bytes
/
RubiksCubeState.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace VirtualRubiksCube
{
public class RubiksCubeState
{
#region Property
public Dictionary<Cubelet, (sbyte, sbyte, sbyte)> CubeletsPosition { get; private set; }
#endregion
#region Contructor
public RubiksCubeState(Dictionary<Cubelet, (sbyte, sbyte, sbyte)> cubeletsPosition)
{
CubeletsPosition = cubeletsPosition;
}
#endregion
#region Method
public RubiksCubeState Clone()
{
Dictionary<Cubelet, (sbyte, sbyte, sbyte)> cubeletsPosition = new();
foreach (KeyValuePair<Cubelet, (sbyte, sbyte, sbyte)> cubeletPosition in CubeletsPosition)
{
(sbyte x, sbyte y, sbyte z) = cubeletPosition.Value;
cubeletsPosition.Add(cubeletPosition.Key, (x, y, z));
}
return new RubiksCubeState(cubeletsPosition);
}
#endregion
}
}