In Haskell you can create a new datatype for example as follows:
Player = Player1 | Player2
And further in your code you can check whether it's Player1 or Player2 by just typing Player1 and not some strange with like "Player1" that it has to be a String or check with an integer. Is something similar possible in C#? I can only think of:
class Player
{
public int CurrentPlayer { get; private set; }
public Player(int plyr)
{
CurrentPlayer = plyr;
}
}
But now I can't check with just thisplayer = Player1 (if thisplayer is a Player). Eventually this sort of means: How can you create your own object that can only have an already defined finite amount of values, for example like Bools?