Fixed probable ILocational NPEs.
Contributed by Sahar.
This commit is contained in:
@@ -76,6 +76,11 @@ public interface ILocational
|
||||
*/
|
||||
default boolean isInFrontOf(ILocational target)
|
||||
{
|
||||
if (target == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Position.FRONT == Position.getPosition(this, target);
|
||||
}
|
||||
|
||||
@@ -85,6 +90,11 @@ public interface ILocational
|
||||
*/
|
||||
default boolean isOnSideOf(ILocational target)
|
||||
{
|
||||
if (target == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Position.SIDE == Position.getPosition(this, target);
|
||||
}
|
||||
|
||||
@@ -94,6 +104,11 @@ public interface ILocational
|
||||
*/
|
||||
default boolean isBehind(ILocational target)
|
||||
{
|
||||
if (target == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Position.BACK == Position.getPosition(this, target);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user