Action blocker for changing direction

This commit is contained in:
zumorica
2020-05-13 19:26:39 +02:00
parent c3c5b87fd5
commit a524eca44b
4 changed files with 32 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ namespace Content.Server.GameObjects.EntitySystems
bool CanAttack() => true;
bool CanEquip() => true;
bool CanUnequip() => true;
bool CanChangeDirection() => true;
}
public class ActionBlockerSystem : EntitySystem
@@ -145,5 +146,17 @@ namespace Content.Server.GameObjects.EntitySystems
return canunequip;
}
public static bool CanChangeDirection(IEntity entity)
{
bool canchangedirection = true;
foreach (var actionblockercomponents in entity.GetAllComponents<IActionBlocker>())
{
canchangedirection &= actionblockercomponents.CanChangeDirection();
}
return canchangedirection;
}
}
}