initial commit
This commit is contained in:
41
YatzyLibrary/Models.cs
Normal file
41
YatzyLibrary/Models.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
namespace YatzyLibrary
|
||||
{
|
||||
public class Die
|
||||
{
|
||||
public int sides { get; set; }
|
||||
|
||||
public int Throw()
|
||||
{
|
||||
Random random = new Random();
|
||||
|
||||
return random.Next(1, sides + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public class CheckOutput
|
||||
{
|
||||
public CheckOutput() { }
|
||||
public CheckOutput(bool success, int value)
|
||||
{
|
||||
this.success = success;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public bool success { get; set; }
|
||||
public int value { get; set; }
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is CheckOutput other)
|
||||
{
|
||||
return success == other.success && value == other.value;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(success, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user