Initial setup for testing AI performance, random fixes
All checks were successful
Build / Build (push) Successful in 54s
All checks were successful
Build / Build (push) Successful in 54s
This commit is contained in:
@@ -27,4 +27,25 @@ public class FleeTurnChoice : TurnChoice, IFleeChoice
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CollectScripts(List<IEnumerable<ScriptContainer>> scripts) => User.CollectScripts(scripts);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => $"FleeChoice: {User}";
|
||||
|
||||
protected bool Equals(FleeTurnChoice other) => other.User == User;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null)
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
if (obj is not FleeTurnChoice other)
|
||||
return false;
|
||||
return Equals(other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() =>
|
||||
User?.GetHashCode() ?? 0;
|
||||
}
|
||||
@@ -59,4 +59,28 @@ public class ItemChoice : TurnChoice, IItemChoice
|
||||
{
|
||||
User.CollectScripts(scripts);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() =>
|
||||
$"ItemChoice: User: {User}, Item: {Item.Name}, TargetSide: {TargetSide}, TargetPosition: {TargetPosition}";
|
||||
|
||||
protected bool Equals(ItemChoice other) =>
|
||||
other.User == User && other.Item.Equals(Item) && other.TargetSide == TargetSide &&
|
||||
other.TargetPosition == TargetPosition;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null)
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
if (obj is not ItemChoice other)
|
||||
return false;
|
||||
return Equals(other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() =>
|
||||
HashCode.Combine(User, Item, TargetSide, TargetPosition);
|
||||
}
|
||||
@@ -105,4 +105,28 @@ public class MoveChoice : TurnChoice, IMoveChoice
|
||||
GetOwnScripts(scripts);
|
||||
User.CollectScripts(scripts);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() =>
|
||||
$"MoveChoice: {ChosenMove.MoveData.Name}, Target: {TargetSide}:{TargetPosition}, User: {User}";
|
||||
|
||||
protected bool Equals(MoveChoice other) =>
|
||||
other.User == User && other.ChosenMove.Equals(ChosenMove) && other.TargetSide == TargetSide &&
|
||||
other.TargetPosition == TargetPosition;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null)
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
if (obj is not MoveChoice other)
|
||||
return false;
|
||||
return Equals(other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() =>
|
||||
HashCode.Combine(User, ChosenMove, TargetSide, TargetPosition);
|
||||
}
|
||||
@@ -30,4 +30,26 @@ public class PassChoice : TurnChoice, IPassChoice
|
||||
{
|
||||
User.CollectScripts(scripts);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() =>
|
||||
$"PassChoice: {User}";
|
||||
|
||||
protected bool Equals(PassChoice other) => other.User == User;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null)
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
if (obj is not PassChoice other)
|
||||
return false;
|
||||
return Equals(other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() =>
|
||||
User?.GetHashCode() ?? 0;
|
||||
}
|
||||
@@ -38,4 +38,27 @@ public class SwitchChoice : TurnChoice, ISwitchChoice
|
||||
{
|
||||
User.CollectScripts(scripts);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() =>
|
||||
$"SwitchChoice: {User} -> {SwitchTo}";
|
||||
|
||||
protected bool Equals(SwitchChoice other) =>
|
||||
other.User == User && other.SwitchTo == SwitchTo;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is null)
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
if (obj is not SwitchChoice other)
|
||||
return false;
|
||||
return Equals(other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode() =>
|
||||
User?.GetHashCode() ?? 0 ^ SwitchTo?.GetHashCode() ?? 0;
|
||||
}
|
||||
Reference in New Issue
Block a user