Fix: Order and OrderTest
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user