Rename IEntity.GetComponents to GetAllComponents. (#68)

* Rename IEntity.GetComponents to GetAllComponents.

This is to avoid confusion.
A single s to distinguish it from GetComponent() is quite hard to miss.

* Update submodule.
This commit is contained in:
Pieter-Jan Briers
2018-05-10 19:21:15 +02:00
committed by GitHub
parent 205a4fc530
commit 20cf3a6a9b
5 changed files with 23 additions and 23 deletions

View File

@@ -119,7 +119,7 @@ namespace Content.Server.GameObjects
void RecalculateComponentThresholds()
{
foreach (IOnDamageBehavior onDamageBehaviorComponent in Owner.GetComponents<IOnDamageBehavior>())
foreach (IOnDamageBehavior onDamageBehaviorComponent in Owner.GetAllComponents<IOnDamageBehavior>())
{
AddThresholdsFrom(onDamageBehaviorComponent);
}

View File

@@ -12,7 +12,7 @@ namespace Content.Server.GameObjects
public void RemovedFromSlot()
{
foreach (var component in Owner.GetComponents<ISpriteRenderableComponent>())
foreach (var component in Owner.GetAllComponents<ISpriteRenderableComponent>())
{
component.Visible = true;
}
@@ -20,7 +20,7 @@ namespace Content.Server.GameObjects
public void EquippedToSlot(ContainerSlot slot)
{
foreach (var component in Owner.GetComponents<ISpriteRenderableComponent>())
foreach (var component in Owner.GetAllComponents<ISpriteRenderableComponent>())
{
component.Visible = false;
}

View File

@@ -54,7 +54,7 @@ namespace Content.Server.GameObjects.EntitySystems
}
//Add component statuses from components that report one
foreach (var examinecomponents in examined.GetComponents<IExamine>())
foreach (var examinecomponents in examined.GetAllComponents<IExamine>())
{
string componentdescription = examinecomponents.Examine();
if (!string.IsNullOrEmpty(componentdescription))

View File

@@ -194,7 +194,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// <param name="clicklocation"></param>
public static void InteractAfterattack(IEntity user, IEntity weapon, LocalCoordinates clicklocation)
{
List<IAfterAttack> afterattacks = weapon.GetComponents<IAfterAttack>().ToList();
List<IAfterAttack> afterattacks = weapon.GetAllComponents<IAfterAttack>().ToList();
for (var i = 0; i < afterattacks.Count; i++)
{
@@ -211,7 +211,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// <param name="attacked"></param>
public static void Interaction(IEntity user, IEntity weapon, IEntity attacked, LocalCoordinates clicklocation)
{
List<IAttackby> interactables = attacked.GetComponents<IAttackby>().ToList();
List<IAttackby> interactables = attacked.GetAllComponents<IAttackby>().ToList();
for (var i = 0; i < interactables.Count; i++)
{
@@ -225,7 +225,7 @@ namespace Content.Server.GameObjects.EntitySystems
//If we aren't directly attacking the nearby object, lets see if our item has an after attack we can do
List<IAfterAttack> afterattacks = weapon.GetComponents<IAfterAttack>().ToList();
List<IAfterAttack> afterattacks = weapon.GetAllComponents<IAfterAttack>().ToList();
for (var i = 0; i < afterattacks.Count; i++)
{
@@ -241,7 +241,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// <param name="attacked"></param>
public static void Interaction(IEntity user, IEntity attacked)
{
List<IAttackHand> interactables = attacked.GetComponents<IAttackHand>().ToList();
List<IAttackHand> interactables = attacked.GetAllComponents<IAttackHand>().ToList();
for (var i = 0; i < interactables.Count; i++)
{
@@ -276,7 +276,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// <param name="attacked"></param>
public static void UseInteraction(IEntity user, IEntity used)
{
List<IUse> usables = used.GetComponents<IUse>().ToList();
List<IUse> usables = used.GetAllComponents<IUse>().ToList();
//Try to use item on any components which have the interface
for (var i = 0; i < usables.Count; i++)
@@ -297,7 +297,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// <param name="attacked"></param>
public static void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, LocalCoordinates clicklocation)
{
List<IRangedAttackby> rangedusables = attacked.GetComponents<IRangedAttackby>().ToList();
List<IRangedAttackby> rangedusables = attacked.GetAllComponents<IRangedAttackby>().ToList();
//See if we have a ranged attack interaction
for (var i = 0; i < rangedusables.Count; i++)
@@ -310,7 +310,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (weapon != null)
{
List<IAfterAttack> afterattacks = weapon.GetComponents<IAfterAttack>().ToList();
List<IAfterAttack> afterattacks = weapon.GetAllComponents<IAfterAttack>().ToList();
//See if we have a ranged attack interaction
for (var i = 0; i < afterattacks.Count; i++)

2
engine

Submodule engine updated: cb469c4f86...1375da7f70