Removed stream usage from OpTargetWeaponAttackTypeSkillCondition.

This commit is contained in:
MobiusDevelopment 2020-10-17 21:47:49 +00:00
parent 574f536495
commit 796ca24552
15 changed files with 240 additions and 15 deletions

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}

View File

@ -50,8 +50,23 @@ public class OpTargetWeaponAttackTypeSkillCondition implements ISkillCondition
{
return false;
}
final Creature targetCreature = (Creature) target;
final Weapon weapon = targetCreature.getActiveWeaponItem();
return _weaponTypes.stream().anyMatch(weaponType -> weaponType == weapon.getItemType());
if (weapon == null)
{
return false;
}
final WeaponType equippedType = weapon.getItemType();
for (WeaponType weaponType : _weaponTypes)
{
if (weaponType == equippedType)
{
return true;
}
}
return false;
}
}