Action blocker for changing direction
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user