public double GetScore(GameUser user) { if (IsDeterministic) { if (Result == user.ToResult()) { return(double.MaxValue); } else if (Result == user.GetNextUser().ToResult()) { return(double.MinValue); } else { return(0); } } var val = Math.Pow(First, 2) - Math.Pow(Second, 2); switch (user) { case GameUser.First: return(val); case GameUser.Second: return(-1 * val); default: return(0); } }
public static GameUser GetPrevUser(this GameUser user) { return(user.GetNextUser()); }