51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
/// Rohmer Maxime <maxluligames@gmail.com>
|
|
/// 28 April 2022
|
|
/// Tile.cs
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace WaveFunctionCollapseCLI
|
|
{
|
|
internal class Tile:ICloneable,IEqualityComparer<Tile>
|
|
{
|
|
private List<TileType> _possibleTyles;
|
|
private List<TileType> _avaibleTypes;
|
|
|
|
internal List<TileType> PossibleTyles { get => _possibleTyles; set => _possibleTyles = value; }
|
|
internal List<TileType> AvaibleTypes { get => _avaibleTypes; set => _avaibleTypes = value; }
|
|
|
|
public Tile(List<TileType> avaibleTypes)
|
|
{
|
|
AvaibleTypes = avaibleTypes;
|
|
PossibleTyles = new List<TileType>();
|
|
foreach (TileType theType in AvaibleTypes)
|
|
{
|
|
PossibleTyles.Add(theType);
|
|
}
|
|
}
|
|
|
|
public object Clone()
|
|
{
|
|
Tile copy = new Tile(this.AvaibleTypes);
|
|
copy.PossibleTyles.Clear();
|
|
foreach (TileType pt in PossibleTyles)
|
|
{
|
|
copy.PossibleTyles.Add((TileType)pt.Clone());
|
|
}
|
|
return copy;
|
|
}
|
|
|
|
public bool Equals(Tile x, Tile y)
|
|
{
|
|
return x.PossibleTyles.Equals(y.PossibleTyles);
|
|
}
|
|
public int GetHashCode(Tile obj)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|