Mam Klasę(krótki kod poniżej). Dlaczego gdy próbuje stworzyć obiekt tej klasy w ten sposób:
Hex? mojObiekt = new Hex()
Otrzymuje błąd:
The type 'SteamGame.Map.Hex' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'System.Nullable<T>'
Przecież ja nie umieszczam tego w żadnej liście. Nie rozumiem w czym jest problem. Mógłby mi to ktoś troszkę przybliżyć?
public abstract class Hex
{
#region Veriables
readonly Dictionary<HexDirections, Hex> neighbors;
#endregion
#region Properties
public Dictionary<HexDirections, Hex> Neighbors
{
get { return this.neighbors; }
}
#endregion
#region Constructors
public Hex()
{
this.neighbors = new Dictionary<HexDirections, Hex>();
}
#endregion
}