Fix: Order and OrderTest

This commit is contained in:
MatteoPellegrino05
2026-03-21 17:13:25 +01:00
parent a9f641eccb
commit c0733f4cd6
8 changed files with 9 additions and 4 deletions
@@ -11,7 +11,7 @@ public class Order2 extends OrderLogicCard {
@Override
public void effect(Player player,int index) throws IndexOutOfBoundsException
{
if(index>=2)
if(index >= 2 || index < 0)
{
throw new IndexOutOfBoundsException("index out of bounds");
}
@@ -12,7 +12,7 @@ public class Order3 extends OrderLogicCard {
@Override
public void effect(Player player,int index) throws IndexOutOfBoundsException
{
if(index>=3)
if(index >= 3 || index < 0)
{
throw new IndexOutOfBoundsException("index out of bounds");
}
@@ -12,7 +12,7 @@ public class Order4 extends OrderLogicCard {
@Override
public void effect(Player player,int index) throws IndexOutOfBoundsException
{
if(index>=4)
if(index>=4 || index < 0)
{
throw new IndexOutOfBoundsException("index out of bounds");
}
@@ -12,7 +12,7 @@ public class Order5 extends OrderLogicCard {
@Override
public void effect(Player player,int index) throws IndexOutOfBoundsException
{
if(index>=5)
if(index>=5 || index < 0)
{
throw new IndexOutOfBoundsException("index out of bounds");
}