Skip to content

Commit

Permalink
Minor refactor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arimger committed Feb 29, 2024
1 parent e3e8b18 commit 11aa622
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Assets/Examples/Prefabs/UIContext.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ GameObject:
- component: {fileID: 1114633846812842680}
- component: {fileID: 1114633846812842679}
m_Layer: 0
m_Name: HandlersContainer [UI]
m_Name: UIHandler
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down
4 changes: 2 additions & 2 deletions Assets/Examples/Scripts/ViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ViewController : MonoBehaviour
[SerializeField, TypeConstraint(typeof(UiView))]
private SerializedType viewType;

private IUiViewsHandler viewsHandler;
private IViewsHandler viewsHandler;

private void Start()
{
Expand All @@ -25,7 +25,7 @@ private void Start()
}

[Inject]
internal void Inject(IUiViewsHandler viewsHandler)
internal void Inject(IViewsHandler viewsHandler)
{
this.viewsHandler = viewsHandler;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Package/Runtime/Cursors/CursorHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ namespace BroWar.UI.Cursors
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("BroWar/UI/Cursors/Cursor Handler")]
public class CursorHandler : UiHandlerBehaviour, IUiCursorHandler
public class CursorHandler : UiHandlerBehaviour, ICursorHandler
{ }
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace BroWar.UI.Cursors
{
public interface IUiCursorHandler
public interface ICursorHandler
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace BroWar.UI.Input
{
public interface IUiInputHandler
public interface IInputHandler
{
Vector2? PointerPosition { get; }
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Package/Runtime/Input/InputHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace BroWar.UI.Input
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("BroWar/UI/Input/Input Handler")]
public class InputHandler : UiHandlerBehaviour, IUiInputHandler
public class InputHandler : UiHandlerBehaviour, IInputHandler
{
[SerializeField, NotNull]
private InputSystemUIInputModule inputModule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace BroWar.UI.Popup
{
public interface IUiPopupHandler
public interface IPopupHandler
{ }
}
2 changes: 1 addition & 1 deletion Assets/Package/Runtime/Popup/PopupHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ namespace BroWar.UI.Popup
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("BroWar/UI/Popup/Popup Handler")]
public class PopupHandler : UiHandlerBehaviour, IUiPopupHandler
public class PopupHandler : UiHandlerBehaviour, IPopupHandler
{ }
}
4 changes: 2 additions & 2 deletions Assets/Package/Runtime/Tooltip/TooltipHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public class TooltipHandler : UiHandlerBehaviour, ITooltipHandler
[Tooltip("Currently active tooltip instance.")]
private TooltipBehaviour activeTooltip;

private IUiInputHandler inputHandler;
private IInputHandler inputHandler;

[Inject]
internal void Inject(IUiInputHandler inputHandler)
internal void Inject(IInputHandler inputHandler)
{
this.inputHandler = inputHandler;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace BroWar.UI.Views
{
using BroWar.Common;

public interface IUiViewsHandler : IInitializableWithArgument<ViewsSettings>
public interface IViewsHandler : IInitializableWithArgument<ViewsSettings>
{
event Action<UiView> OnShowView;
event Action<UiView> OnHideView;
Expand Down
6 changes: 3 additions & 3 deletions Assets/Package/Runtime/Views/ViewsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ namespace BroWar.UI.Views
{
using BroWar.Common;

/// <inheritdoc cref="IUiViewsHandler"/>
/// <inheritdoc cref="IViewsHandler"/>
[DisallowMultipleComponent]
[AddComponentMenu("BroWar/UI/Views/Views Handler")]
public class ViewsHandler : UiHandlerBehaviour, IUiViewsHandler
public class ViewsHandler : UiHandlerBehaviour, IViewsHandler
{
protected readonly IDictionary<Type, UiView> viewsByTypes = new Dictionary<Type, UiView>();
protected readonly List<UiView> activeViews = new List<UiView>();
Expand Down Expand Up @@ -338,7 +338,7 @@ public List<UiView> GetAllViews()
/// <inheritdoc cref="IInitializable"/>
public bool IsInitialized { get; private set; }

/// <inheritdoc cref="IUiViewsHandler"/>
/// <inheritdoc cref="IViewsHandler"/>
public IReadOnlyList<UiView> ActiveViews => activeViews;
}
}

0 comments on commit 11aa622

Please sign in to comment.