From 82db8833f08bb0a32a19d374e27c2e462fa28d08 Mon Sep 17 00:00:00 2001 From: Ryan089 <64360820+Ryan089@users.noreply.github.com> Date: Wed, 2 Jun 2021 12:02:42 +1000 Subject: [PATCH] Renamed Interaction methods to reduce confusion. (#680) - CreateInteractions renamed to GenerateInteractionsFromSource - GenerateInteractions renamed to GenerateInteractionsFromTarget Co-authored-by: CosmicCoincidence --- Assets/Content/Furniture/Generic/WaterCooler.cs | 2 +- .../Furniture/Machines/Atmospherics/Canister/Canister.cs | 2 +- .../Machines/Atmospherics/Disposal Bin/DisposalBin.cs | 2 +- .../Furniture/Machines/Kitchen/Microwave/Microwave.cs | 2 +- .../Furniture/Machines/Kitchen/SubstanceDispenser.cs | 2 +- Assets/Content/Furniture/Machines/Vendors/Vendor.cs | 2 +- Assets/Content/Furniture/NetworkedOpenable.cs | 2 +- Assets/Content/Furniture/Openable.cs | 2 +- Assets/Content/Furniture/Storage/StorageContainer.cs | 4 ++-- .../Items/Consumables/Chemical/Cigarettes/Cigarette.cs | 4 ++-- Assets/Content/Items/Consumables/Food/Consumable.cs | 4 ++-- Assets/Content/Items/Cosmetic/Bikehorn.cs | 4 ++-- Assets/Content/Items/Cosmetic/ServiceBell.cs | 4 ++-- .../Items/Functional/Containers/Liquid/PepperSpray.cs | 4 ++-- Assets/Content/Items/Functional/Generic/Boombox.cs | 2 +- Assets/Content/Items/Functional/Tools/Generic/Crowbar.cs | 4 ++-- .../Content/Items/Functional/Tools/Generic/Flashlight.cs | 4 ++-- .../Items/Functional/Tools/Generic/Welders/Welder.cs | 8 ++++---- Assets/Content/Items/Functional/Tools/Generic/Wrench.cs | 4 ++-- .../Items/Weapons/Melee/Sharp/Energy Sword/EnergySword.cs | 4 ++-- .../Structures/Wall Mounts/Lights/EmergencyLightObject.cs | 2 +- .../Content/Structures/Wall Mounts/Lights/SimpleLight.cs | 2 +- .../Content/Systems/Construction/ConstructionMaterial.cs | 2 +- .../Content/Systems/Interactions/SimpleCraftingTarget.cs | 2 +- Assets/Engine/Atmospherics/Machinery/FilterObject.cs | 2 +- Assets/Engine/Atmospherics/Machinery/MixerObject.cs | 2 +- Assets/Engine/Atmospherics/Machinery/PumpObject.cs | 2 +- Assets/Engine/Atmospherics/Machinery/ScrubberObject.cs | 2 +- Assets/Engine/Atmospherics/Machinery/ValveObject.cs | 2 +- Assets/Engine/Atmospherics/Machinery/VentObject.cs | 2 +- Assets/Engine/Interactions/IInteractionSource.cs | 2 +- Assets/Engine/Interactions/IInteractionSourceExtension.cs | 2 +- Assets/Engine/Interactions/IInteractionTarget.cs | 2 +- Assets/Engine/Interactions/InteractionHandler.cs | 4 ++-- .../Interactions/InteractionSourceNetworkBehaviour.cs | 4 ++-- Assets/Engine/Interactions/InteractionTargetBehaviour.cs | 2 +- Assets/Engine/Interactions/InteractionTargetGameObject.cs | 2 +- .../Interactions/InteractionTargetNetworkBehaviour.cs | 2 +- Assets/Engine/Inventory/Item.cs | 6 +++--- Assets/Engine/Substances/SubstanceContainer.cs | 2 +- 40 files changed, 57 insertions(+), 57 deletions(-) diff --git a/Assets/Content/Furniture/Generic/WaterCooler.cs b/Assets/Content/Furniture/Generic/WaterCooler.cs index c61710b975..f266cb03bc 100644 --- a/Assets/Content/Furniture/Generic/WaterCooler.cs +++ b/Assets/Content/Furniture/Generic/WaterCooler.cs @@ -15,7 +15,7 @@ public class WaterCooler : InteractionTargetBehaviour, IExaminable // how many we have now public int NumberOfCups; - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { diff --git a/Assets/Content/Furniture/Machines/Atmospherics/Canister/Canister.cs b/Assets/Content/Furniture/Machines/Atmospherics/Canister/Canister.cs index 8a6fe0e2d5..449694c4a5 100644 --- a/Assets/Content/Furniture/Machines/Atmospherics/Canister/Canister.cs +++ b/Assets/Content/Furniture/Machines/Atmospherics/Canister/Canister.cs @@ -54,7 +54,7 @@ private void Start() //canisterUI.label.text = transform.name; } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { // TODO: Update the interaction names and remove the increase/decrease pressure // Create a custom interaction for opening the menu diff --git a/Assets/Content/Furniture/Machines/Atmospherics/Disposal Bin/DisposalBin.cs b/Assets/Content/Furniture/Machines/Atmospherics/Disposal Bin/DisposalBin.cs index a2eb89d799..ba35d653e2 100644 --- a/Assets/Content/Furniture/Machines/Atmospherics/Disposal Bin/DisposalBin.cs +++ b/Assets/Content/Furniture/Machines/Atmospherics/Disposal Bin/DisposalBin.cs @@ -95,7 +95,7 @@ public void DisposeContents() } } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { List interactions = new List(); diff --git a/Assets/Content/Furniture/Machines/Kitchen/Microwave/Microwave.cs b/Assets/Content/Furniture/Machines/Kitchen/Microwave/Microwave.cs index 299e109179..2eac32108b 100644 --- a/Assets/Content/Furniture/Machines/Kitchen/Microwave/Microwave.cs +++ b/Assets/Content/Furniture/Machines/Kitchen/Microwave/Microwave.cs @@ -53,7 +53,7 @@ private void Start() light.enabled = false; } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] {new SimpleInteraction { diff --git a/Assets/Content/Furniture/Machines/Kitchen/SubstanceDispenser.cs b/Assets/Content/Furniture/Machines/Kitchen/SubstanceDispenser.cs index 1139026c08..904e39bf3c 100644 --- a/Assets/Content/Furniture/Machines/Kitchen/SubstanceDispenser.cs +++ b/Assets/Content/Furniture/Machines/Kitchen/SubstanceDispenser.cs @@ -21,7 +21,7 @@ public class SubstanceDispenser : InteractionTargetBehaviour /// How much should be dispensed /// public float Moles; - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { var registry = FindObjectOfType(); Substance substance = registry.FromId(Substance); diff --git a/Assets/Content/Furniture/Machines/Vendors/Vendor.cs b/Assets/Content/Furniture/Machines/Vendors/Vendor.cs index f55fe3725f..fd320fc050 100644 --- a/Assets/Content/Furniture/Machines/Vendors/Vendor.cs +++ b/Assets/Content/Furniture/Machines/Vendors/Vendor.cs @@ -54,7 +54,7 @@ private void Start() audioSource = GetComponent(); } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { var interaction = new SimpleInteraction { diff --git a/Assets/Content/Furniture/NetworkedOpenable.cs b/Assets/Content/Furniture/NetworkedOpenable.cs index 9970dad2ef..362559c0c8 100644 --- a/Assets/Content/Furniture/NetworkedOpenable.cs +++ b/Assets/Content/Furniture/NetworkedOpenable.cs @@ -17,7 +17,7 @@ public class NetworkedOpenable : InteractionTargetNetworkBehaviour [SerializeField] private Sprite OpenIcon; - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { OpenInteraction openInteraction = new OpenInteraction(); openInteraction.icon = OpenIcon; diff --git a/Assets/Content/Furniture/Openable.cs b/Assets/Content/Furniture/Openable.cs index c454c245a2..af24cb4028 100644 --- a/Assets/Content/Furniture/Openable.cs +++ b/Assets/Content/Furniture/Openable.cs @@ -18,7 +18,7 @@ public class Openable : InteractionTargetBehaviour // This defines the icon that will be shown in the interaction menu [SerializeField] private Sprite openInteractionIcon; - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { // Here we generate the interactions when we are not holding the item OpenInteraction openInteraction = new OpenInteraction(); diff --git a/Assets/Content/Furniture/Storage/StorageContainer.cs b/Assets/Content/Furniture/Storage/StorageContainer.cs index 0ecc20005f..76945a6672 100644 --- a/Assets/Content/Furniture/Storage/StorageContainer.cs +++ b/Assets/Content/Furniture/Storage/StorageContainer.cs @@ -15,12 +15,12 @@ public class StorageContainer : NetworkedOpenable [SerializeField] private Sprite viewContainerIcon; - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { // The "open" state is changed via the object interaction // so we don't need to worry about that here, unless we can store stuff without needing it to open - List interactions = base.GenerateInteractions(interactionEvent).ToList(); + List interactions = base.GenerateInteractionsFromTarget(interactionEvent).ToList(); StoreInteraction storeInteraction = new StoreInteraction(); ViewContainerInteraction view = new ViewContainerInteraction {MaxDistance = MaxDistance, icon = viewContainerIcon}; diff --git a/Assets/Content/Items/Consumables/Chemical/Cigarettes/Cigarette.cs b/Assets/Content/Items/Consumables/Chemical/Cigarettes/Cigarette.cs index 5acd391247..a4e745d75a 100644 --- a/Assets/Content/Items/Consumables/Chemical/Cigarettes/Cigarette.cs +++ b/Assets/Content/Items/Consumables/Chemical/Cigarettes/Cigarette.cs @@ -119,9 +119,9 @@ private void ConsumeUpdate() RpcUpdateMesh(); } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { - List interactions = base.GenerateInteractions(interactionEvent).ToList(); + List interactions = base.GenerateInteractionsFromTarget(interactionEvent).ToList(); interactions.Add(new IgniteInteraction() { extinguishIcon = extinguishIcon, igniteIcon = igniteIcon }); return interactions.ToArray(); } diff --git a/Assets/Content/Items/Consumables/Food/Consumable.cs b/Assets/Content/Items/Consumables/Food/Consumable.cs index 57ae518c6f..a207d439df 100644 --- a/Assets/Content/Items/Consumables/Food/Consumable.cs +++ b/Assets/Content/Items/Consumables/Food/Consumable.cs @@ -106,7 +106,7 @@ void RpcPlayEatingSound(float pitch, int audioClip) } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { List list = new List(); list.Add(new ConsumeInteraction {icon = item.sprite, Verb = consumeVerb, LoadingBarPrefab = LoadingBarPrefab}); @@ -114,7 +114,7 @@ public override IInteraction[] GenerateInteractions(InteractionEvent interaction return list.ToArray(); } - public void CreateInteractions(IInteractionTarget[] targets, List interactions) + public void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions) { interactions.Add(new InteractionEntry(targets[0], new ConsumeInteraction {icon = item.sprite, Verb = consumeVerb, LoadingBarPrefab = LoadingBarPrefab })); } diff --git a/Assets/Content/Items/Cosmetic/Bikehorn.cs b/Assets/Content/Items/Cosmetic/Bikehorn.cs index 60163493c1..28710519d4 100644 --- a/Assets/Content/Items/Cosmetic/Bikehorn.cs +++ b/Assets/Content/Items/Cosmetic/Bikehorn.cs @@ -96,9 +96,9 @@ private void RpcPlayHonk() audioSource.PlayOneShot(honkSound); } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { - List list = base.GenerateInteractions(interactionEvent).ToList(); + List list = base.GenerateInteractionsFromTarget(interactionEvent).ToList(); list.Add(new HonkInteraction{ icon = useIcon }); return list.ToArray(); } diff --git a/Assets/Content/Items/Cosmetic/ServiceBell.cs b/Assets/Content/Items/Cosmetic/ServiceBell.cs index 0a7ec8c855..7df9d773ae 100644 --- a/Assets/Content/Items/Cosmetic/ServiceBell.cs +++ b/Assets/Content/Items/Cosmetic/ServiceBell.cs @@ -92,9 +92,9 @@ private void RpcPlayBell() audioSource.PlayOneShot(bellSound); } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { - List interactions = base.GenerateInteractions(interactionEvent).ToList(); + List interactions = base.GenerateInteractionsFromTarget(interactionEvent).ToList(); interactions.Insert(0, new BellInteraction()); return interactions.ToArray(); } diff --git a/Assets/Content/Items/Functional/Containers/Liquid/PepperSpray.cs b/Assets/Content/Items/Functional/Containers/Liquid/PepperSpray.cs index bd15139986..edcec02b44 100644 --- a/Assets/Content/Items/Functional/Containers/Liquid/PepperSpray.cs +++ b/Assets/Content/Items/Functional/Containers/Liquid/PepperSpray.cs @@ -116,9 +116,9 @@ private void RpcSpray() justSprayed = true; } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { - List list = base.GenerateInteractions(interactionEvent).ToList(); + List list = base.GenerateInteractionsFromTarget(interactionEvent).ToList(); list.Add(new SprayInteraction { icon = useIcon }); return list.ToArray(); } diff --git a/Assets/Content/Items/Functional/Generic/Boombox.cs b/Assets/Content/Items/Functional/Generic/Boombox.cs index ecdca36044..4f26abfc3b 100644 --- a/Assets/Content/Items/Functional/Generic/Boombox.cs +++ b/Assets/Content/Items/Functional/Generic/Boombox.cs @@ -166,7 +166,7 @@ public bool GetState() return radioOn; } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { List interactions = new List(2) { diff --git a/Assets/Content/Items/Functional/Tools/Generic/Crowbar.cs b/Assets/Content/Items/Functional/Tools/Generic/Crowbar.cs index 5dcd859515..b8b8187316 100644 --- a/Assets/Content/Items/Functional/Tools/Generic/Crowbar.cs +++ b/Assets/Content/Items/Functional/Tools/Generic/Crowbar.cs @@ -24,9 +24,9 @@ public class Crowbar : Item public Sprite constructIcon; - public override void CreateInteractions(IInteractionTarget[] targets, List interactions) + public override void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions) { - base.CreateInteractions(targets, interactions); + base.GenerateInteractionsFromSource(targets, interactions); var wallConstructionInteraction = new WallConstructionInteraction { WallToConstruct = WallToConstruct, diff --git a/Assets/Content/Items/Functional/Tools/Generic/Flashlight.cs b/Assets/Content/Items/Functional/Tools/Generic/Flashlight.cs index fa5f046a82..971cb80c08 100644 --- a/Assets/Content/Items/Functional/Tools/Generic/Flashlight.cs +++ b/Assets/Content/Items/Functional/Tools/Generic/Flashlight.cs @@ -15,9 +15,9 @@ public class Flashlight : Item public new Light light = null; public Sprite turnOnIcon; - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { - List list = base.GenerateInteractions(interactionEvent).ToList(); + List list = base.GenerateInteractionsFromTarget(interactionEvent).ToList(); list.Add(new FlashlightInteraction{ icon = turnOnIcon }); return list.ToArray(); } diff --git a/Assets/Content/Items/Functional/Tools/Generic/Welders/Welder.cs b/Assets/Content/Items/Functional/Tools/Generic/Welders/Welder.cs index 91a4de9d13..b3daf53cfd 100644 --- a/Assets/Content/Items/Functional/Tools/Generic/Welders/Welder.cs +++ b/Assets/Content/Items/Functional/Tools/Generic/Welders/Welder.cs @@ -94,9 +94,9 @@ public void Toggle() RpcTurnOn(!hotFlame.isEmitting); } - public override void CreateInteractions(IInteractionTarget[] targets, List interactions) + public override void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions) { - base.CreateInteractions(targets, interactions); + base.GenerateInteractionsFromSource(targets, interactions); interactions.Insert(0, new InteractionEntry(targets[0], new WelderConstructionInteraction { TurfReinforceList = reinforceDict, @@ -106,9 +106,9 @@ public override void CreateInteractions(IInteractionTarget[] targets, List list = base.GenerateInteractions(interactionEvent).ToList(); + List list = base.GenerateInteractionsFromTarget(interactionEvent).ToList(); ToggleInteraction toggleInteraction = new ToggleInteraction { diff --git a/Assets/Content/Items/Functional/Tools/Generic/Wrench.cs b/Assets/Content/Items/Functional/Tools/Generic/Wrench.cs index df284b218e..1dded37029 100644 --- a/Assets/Content/Items/Functional/Tools/Generic/Wrench.cs +++ b/Assets/Content/Items/Functional/Tools/Generic/Wrench.cs @@ -20,9 +20,9 @@ public class Wrench : Item public Sprite constructIcon; - public override void CreateInteractions(IInteractionTarget[] targets, List interactions) + public override void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions) { - base.CreateInteractions(targets, interactions); + base.GenerateInteractionsFromSource(targets, interactions); interactions.Insert(0, new InteractionEntry(targets[0], new TableConstructionInteraction { TableToConstruct = TableToConstruct, Delay = Delay, diff --git a/Assets/Content/Items/Weapons/Melee/Sharp/Energy Sword/EnergySword.cs b/Assets/Content/Items/Weapons/Melee/Sharp/Energy Sword/EnergySword.cs index 9f212e46f0..d1aa51c306 100644 --- a/Assets/Content/Items/Weapons/Melee/Sharp/Energy Sword/EnergySword.cs +++ b/Assets/Content/Items/Weapons/Melee/Sharp/Energy Sword/EnergySword.cs @@ -56,9 +56,9 @@ public void Toggle() RpcSetBlade(on); } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { - List list = base.GenerateInteractions(interactionEvent).ToList(); + List list = base.GenerateInteractionsFromTarget(interactionEvent).ToList(); list.Add(new ToggleInteraction { OnName = "Turn off", diff --git a/Assets/Content/Structures/Wall Mounts/Lights/EmergencyLightObject.cs b/Assets/Content/Structures/Wall Mounts/Lights/EmergencyLightObject.cs index b0b79ae5cd..bbb8fac8e2 100644 --- a/Assets/Content/Structures/Wall Mounts/Lights/EmergencyLightObject.cs +++ b/Assets/Content/Structures/Wall Mounts/Lights/EmergencyLightObject.cs @@ -23,7 +23,7 @@ void Start() } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { var interaction = new SimpleInteraction { diff --git a/Assets/Content/Structures/Wall Mounts/Lights/SimpleLight.cs b/Assets/Content/Structures/Wall Mounts/Lights/SimpleLight.cs index 58835090df..3fac777dff 100644 --- a/Assets/Content/Structures/Wall Mounts/Lights/SimpleLight.cs +++ b/Assets/Content/Structures/Wall Mounts/Lights/SimpleLight.cs @@ -21,7 +21,7 @@ void Start() lights = GetComponentsInChildren(); } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { var interaction = new SimpleInteraction { diff --git a/Assets/Content/Systems/Construction/ConstructionMaterial.cs b/Assets/Content/Systems/Construction/ConstructionMaterial.cs index 7da469c8df..7a2174d9eb 100644 --- a/Assets/Content/Systems/Construction/ConstructionMaterial.cs +++ b/Assets/Content/Systems/Construction/ConstructionMaterial.cs @@ -32,7 +32,7 @@ private void Start() item = GetComponent(); } - public void CreateInteractions(IInteractionTarget[] targets, List interactions) + public void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions) { interactions.Add(new InteractionEntry(targets.First(), new SimpleInteraction { diff --git a/Assets/Content/Systems/Interactions/SimpleCraftingTarget.cs b/Assets/Content/Systems/Interactions/SimpleCraftingTarget.cs index 8ba75485d6..08f2b251a3 100644 --- a/Assets/Content/Systems/Interactions/SimpleCraftingTarget.cs +++ b/Assets/Content/Systems/Interactions/SimpleCraftingTarget.cs @@ -22,7 +22,7 @@ public class SimpleCraftingTarget : InteractionTargetBehaviour /// public SimpleCraftingInteraction.CraftingResult[] ResultingObjects; - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { new SimpleCraftingInteraction { diff --git a/Assets/Engine/Atmospherics/Machinery/FilterObject.cs b/Assets/Engine/Atmospherics/Machinery/FilterObject.cs index 5559c12d54..0559a5fd1b 100644 --- a/Assets/Engine/Atmospherics/Machinery/FilterObject.cs +++ b/Assets/Engine/Atmospherics/Machinery/FilterObject.cs @@ -110,7 +110,7 @@ public void Step() - public IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { diff --git a/Assets/Engine/Atmospherics/Machinery/MixerObject.cs b/Assets/Engine/Atmospherics/Machinery/MixerObject.cs index 9bf389493c..273ac5a5bc 100644 --- a/Assets/Engine/Atmospherics/Machinery/MixerObject.cs +++ b/Assets/Engine/Atmospherics/Machinery/MixerObject.cs @@ -121,7 +121,7 @@ public void Step() } } - public IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { diff --git a/Assets/Engine/Atmospherics/Machinery/PumpObject.cs b/Assets/Engine/Atmospherics/Machinery/PumpObject.cs index 99f25ae097..df03c34b38 100644 --- a/Assets/Engine/Atmospherics/Machinery/PumpObject.cs +++ b/Assets/Engine/Atmospherics/Machinery/PumpObject.cs @@ -107,7 +107,7 @@ public void Initialize() SetAtmosNeighbours(); } - public IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { diff --git a/Assets/Engine/Atmospherics/Machinery/ScrubberObject.cs b/Assets/Engine/Atmospherics/Machinery/ScrubberObject.cs index 4f3d7286e3..cb9466d599 100644 --- a/Assets/Engine/Atmospherics/Machinery/ScrubberObject.cs +++ b/Assets/Engine/Atmospherics/Machinery/ScrubberObject.cs @@ -210,7 +210,7 @@ public void SetAtmosNeighbours() } } - public IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { diff --git a/Assets/Engine/Atmospherics/Machinery/ValveObject.cs b/Assets/Engine/Atmospherics/Machinery/ValveObject.cs index 43da08dc1c..83cd300476 100644 --- a/Assets/Engine/Atmospherics/Machinery/ValveObject.cs +++ b/Assets/Engine/Atmospherics/Machinery/ValveObject.cs @@ -37,7 +37,7 @@ void Start() SetValve(false); } - public IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { diff --git a/Assets/Engine/Atmospherics/Machinery/VentObject.cs b/Assets/Engine/Atmospherics/Machinery/VentObject.cs index 481789c663..e1fb36a179 100644 --- a/Assets/Engine/Atmospherics/Machinery/VentObject.cs +++ b/Assets/Engine/Atmospherics/Machinery/VentObject.cs @@ -140,7 +140,7 @@ public void SetAtmosNeighbours() return; } - public IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { diff --git a/Assets/Engine/Interactions/IInteractionSource.cs b/Assets/Engine/Interactions/IInteractionSource.cs index aaf23f98ac..28aad31dfe 100644 --- a/Assets/Engine/Interactions/IInteractionSource.cs +++ b/Assets/Engine/Interactions/IInteractionSource.cs @@ -11,7 +11,7 @@ public interface IInteractionSource /// /// The interaction targets of this interaction /// The already present interactions - void CreateInteractions(IInteractionTarget[] targets, List interactions); + void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions); /// /// Checks if this source can interact with a certain target /// diff --git a/Assets/Engine/Interactions/IInteractionSourceExtension.cs b/Assets/Engine/Interactions/IInteractionSourceExtension.cs index 155cfa001d..3d637bc0a0 100644 --- a/Assets/Engine/Interactions/IInteractionSourceExtension.cs +++ b/Assets/Engine/Interactions/IInteractionSourceExtension.cs @@ -13,6 +13,6 @@ public interface IInteractionSourceExtension /// /// The interaction targets of this interaction /// The already present interactions - void CreateInteractions(IInteractionTarget[] targets, List interactions); + void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions); } } diff --git a/Assets/Engine/Interactions/IInteractionTarget.cs b/Assets/Engine/Interactions/IInteractionTarget.cs index 2abdf51292..3e25f9ee7d 100644 --- a/Assets/Engine/Interactions/IInteractionTarget.cs +++ b/Assets/Engine/Interactions/IInteractionTarget.cs @@ -10,6 +10,6 @@ public interface IInteractionTarget /// /// The interaction event /// All possible interactions - IInteraction[] GenerateInteractions(InteractionEvent interactionEvent); + IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent); } } \ No newline at end of file diff --git a/Assets/Engine/Interactions/InteractionHandler.cs b/Assets/Engine/Interactions/InteractionHandler.cs index c88eb5fb54..a4aee0729a 100644 --- a/Assets/Engine/Interactions/InteractionHandler.cs +++ b/Assets/Engine/Interactions/InteractionHandler.cs @@ -341,12 +341,12 @@ private List GetInteractionsFromTargets(IInteractionSource sou { // Generate interactions on targets List interactions = targets.SelectMany(t => - t.GenerateInteractions(new InteractionEvent(source, t, @event.Point)) + t.GenerateInteractionsFromTarget(new InteractionEvent(source, t, @event.Point)) .Select(i => new InteractionEntry(t, i)) ).ToList(); // Allow the source to add its own interactions - source.CreateInteractions(targets.ToArray(), interactions); + source.GenerateInteractionsFromSource(targets.ToArray(), interactions); // Filter interactions to possible ones return interactions.Where(i => i.Interaction.CanInteract(new InteractionEvent(source, i.Target, @event.Point))).ToList(); diff --git a/Assets/Engine/Interactions/InteractionSourceNetworkBehaviour.cs b/Assets/Engine/Interactions/InteractionSourceNetworkBehaviour.cs index a086296a74..523e89d304 100644 --- a/Assets/Engine/Interactions/InteractionSourceNetworkBehaviour.cs +++ b/Assets/Engine/Interactions/InteractionSourceNetworkBehaviour.cs @@ -108,11 +108,11 @@ public virtual void Update() } - public virtual void CreateInteractions(IInteractionTarget[] targets, List interactions) + public virtual void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions) { foreach (var extension in GetComponents()) { - extension.CreateInteractions(targets, interactions); + extension.GenerateInteractionsFromSource(targets, interactions); } } diff --git a/Assets/Engine/Interactions/InteractionTargetBehaviour.cs b/Assets/Engine/Interactions/InteractionTargetBehaviour.cs index 8d35b61401..bab491a659 100644 --- a/Assets/Engine/Interactions/InteractionTargetBehaviour.cs +++ b/Assets/Engine/Interactions/InteractionTargetBehaviour.cs @@ -5,6 +5,6 @@ namespace SS3D.Engine.Interactions public abstract class InteractionTargetBehaviour : MonoBehaviour, IInteractionTarget, IGameObjectProvider { public GameObject GameObject => gameObject; - public abstract IInteraction[] GenerateInteractions(InteractionEvent interactionEvent); + public abstract IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent); } } \ No newline at end of file diff --git a/Assets/Engine/Interactions/InteractionTargetGameObject.cs b/Assets/Engine/Interactions/InteractionTargetGameObject.cs index 658e411dde..e4dd3ad0fd 100644 --- a/Assets/Engine/Interactions/InteractionTargetGameObject.cs +++ b/Assets/Engine/Interactions/InteractionTargetGameObject.cs @@ -14,7 +14,7 @@ public InteractionTargetGameObject(GameObject gameObject) public GameObject GameObject { get; } - public IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[0]; } diff --git a/Assets/Engine/Interactions/InteractionTargetNetworkBehaviour.cs b/Assets/Engine/Interactions/InteractionTargetNetworkBehaviour.cs index bd91976910..54cb0747a4 100644 --- a/Assets/Engine/Interactions/InteractionTargetNetworkBehaviour.cs +++ b/Assets/Engine/Interactions/InteractionTargetNetworkBehaviour.cs @@ -5,7 +5,7 @@ namespace SS3D.Engine.Interactions { public abstract class InteractionTargetNetworkBehaviour : NetworkBehaviour, IInteractionTarget, IGameObjectProvider { - public abstract IInteraction[] GenerateInteractions(InteractionEvent interactionEvent); + public abstract IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent); public GameObject GameObject => gameObject; } } \ No newline at end of file diff --git a/Assets/Engine/Inventory/Item.cs b/Assets/Engine/Inventory/Item.cs index 94b7aedf12..26a39e1ac2 100644 --- a/Assets/Engine/Inventory/Item.cs +++ b/Assets/Engine/Inventory/Item.cs @@ -125,9 +125,9 @@ public void GenerateNewIcon() } // this creates the base interactions for an item, in this case, the drop interaction - public override void CreateInteractions(IInteractionTarget[] targets, List interactions) + public override void GenerateInteractionsFromSource(IInteractionTarget[] targets, List interactions) { - base.CreateInteractions(targets, interactions); + base.GenerateInteractionsFromSource(targets, interactions); DropInteraction dropInteraction = new DropInteraction(); interactions.Add(new InteractionEntry(null, dropInteraction)); } @@ -302,7 +302,7 @@ private Vector3 RotatePointAround(Vector3 point, Vector3 pivot, Vector3 angles) } #endif - public virtual IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public virtual IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] { new PickupInteraction { icon = sprite } }; } diff --git a/Assets/Engine/Substances/SubstanceContainer.cs b/Assets/Engine/Substances/SubstanceContainer.cs index f25bd3415e..c4ca1e9a2f 100644 --- a/Assets/Engine/Substances/SubstanceContainer.cs +++ b/Assets/Engine/Substances/SubstanceContainer.cs @@ -287,7 +287,7 @@ protected virtual void OnContentsChanged() ContentsChanged?.Invoke(this); } - public override IInteraction[] GenerateInteractions(InteractionEvent interactionEvent) + public override IInteraction[] GenerateInteractionsFromTarget(InteractionEvent interactionEvent) { return new IInteraction[] {