Rename pilot adapters to controllers
This commit is contained in:
parent
a9e21eacef
commit
d4f6155cdc
8 changed files with 90 additions and 80 deletions
|
|
@ -20,8 +20,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
private AetheriaUnityObservedEntityRestorer _observedEntityRestorer;
|
||||
private AetheriaUnityCurrentEntityBinder _currentEntityBinder;
|
||||
private AetheriaUnityObservedZoneContextFactory _observedZoneContextFactory;
|
||||
private AetheriaUnityPilotFrameAdapter _pilotFrameAdapter;
|
||||
private AetheriaUnityPilotOperationAdapter _pilotOperationAdapter;
|
||||
private AetheriaUnityPilotFrameController _pilotFrameController;
|
||||
private AetheriaUnityPilotOperationController _pilotOperationController;
|
||||
private AetheriaUnityObservedTargetQuery _observedTargetQuery;
|
||||
private AetheriaUnityObservedFrameApplier _observedFrameApplier;
|
||||
private AetheriaUnityEntityBlueprintMaterializer _entityBlueprintMaterializer;
|
||||
|
|
@ -71,8 +71,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
PlayMusic = PlayMusic,
|
||||
UpdateTargetPanel = target => CockpitHudShell.UpdateTarget(target, CurrentEntity)
|
||||
};
|
||||
private AetheriaUnityPilotFrameAdapter PilotFrameAdapter =>
|
||||
_pilotFrameAdapter ??= new AetheriaUnityPilotFrameAdapter(direction => _viewDirection = direction)
|
||||
private AetheriaUnityPilotFrameController PilotFrameController =>
|
||||
_pilotFrameController ??= new AetheriaUnityPilotFrameController(direction => _viewDirection = direction)
|
||||
{
|
||||
ZoneRenderer = ZoneRenderer,
|
||||
Input = Input,
|
||||
|
|
@ -82,8 +82,8 @@ public class ActionGameManager : MonoBehaviour
|
|||
SevereHeatstrokePost = SevereHeatstrokePost,
|
||||
Sensitivity = Sensitivity
|
||||
};
|
||||
private AetheriaUnityPilotOperationAdapter PilotOperationAdapter =>
|
||||
_pilotOperationAdapter ??= new AetheriaUnityPilotOperationAdapter(
|
||||
private AetheriaUnityPilotOperationController PilotOperationController =>
|
||||
_pilotOperationController ??= new AetheriaUnityPilotOperationController(
|
||||
() => PilotCommands,
|
||||
_observedEntityIndex,
|
||||
() => _viewDirection,
|
||||
|
|
@ -141,7 +141,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
MenuShell = MenuShell,
|
||||
DragSession = _dragSession,
|
||||
ActionBarPresentation = _actionBarPresentation,
|
||||
PilotOperationAdapter = PilotOperationAdapter,
|
||||
PilotOperationController = PilotOperationController,
|
||||
ResolveCurrentEntity = () => CurrentEntity,
|
||||
SetInput = input => Input = input
|
||||
};
|
||||
|
|
@ -161,7 +161,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
IsCurrentEntityUndocked = IsCurrentEntityObservedUndocked,
|
||||
ApplyLatestZoneRender = () => ObservedFrameApplier.ApplyLatestZoneRender(),
|
||||
CurrentEntityPresentation = _currentEntityPresentation,
|
||||
PilotFrameAdapter = PilotFrameAdapter,
|
||||
PilotFrameController = PilotFrameController,
|
||||
TargetPresentation = _targetPresentation
|
||||
};
|
||||
private AetheriaUnityGameplayBootShell GameplayBootShell =>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public sealed class AetheriaUnityGameplayInputShell : IDisposable
|
|||
public AetheriaUnityMenuShell MenuShell { get; set; }
|
||||
public AetheriaUnityDragSession DragSession { get; set; }
|
||||
public AetheriaUnityActionBarPresentation ActionBarPresentation { get; set; }
|
||||
public AetheriaUnityPilotOperationAdapter PilotOperationAdapter { get; set; }
|
||||
public AetheriaUnityPilotOperationController PilotOperationController { get; set; }
|
||||
public Func<Entity> ResolveCurrentEntity { get; set; }
|
||||
public Action<AetheriaInput> SetInput { get; set; }
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ public sealed class AetheriaUnityGameplayInputShell : IDisposable
|
|||
return;
|
||||
}
|
||||
|
||||
PilotOperationAdapter.RequestInteract();
|
||||
PilotOperationController.RequestInteract();
|
||||
};
|
||||
|
||||
Input.Global.MainMenu.performed += context =>
|
||||
|
|
@ -153,21 +153,21 @@ public sealed class AetheriaUnityGameplayInputShell : IDisposable
|
|||
{
|
||||
var currentEntity = ResolveCurrentEntity?.Invoke();
|
||||
if (currentEntity != null)
|
||||
PilotOperationAdapter.RequestOverrideShutdown(!currentEntity.OverrideShutdown);
|
||||
PilotOperationController.RequestOverrideShutdown(!currentEntity.OverrideShutdown);
|
||||
};
|
||||
|
||||
Input.Player.Ping.performed += context => PilotOperationAdapter.RequestSensorPing();
|
||||
Input.Player.Ping.performed += context => PilotOperationController.RequestSensorPing();
|
||||
Input.Player.ToggleHeatsinks.performed += context =>
|
||||
{
|
||||
var currentEntity = ResolveCurrentEntity?.Invoke();
|
||||
if (currentEntity != null)
|
||||
PilotOperationAdapter.RequestHeatsinksEnabled(!currentEntity.HeatsinksEnabled);
|
||||
PilotOperationController.RequestHeatsinksEnabled(!currentEntity.HeatsinksEnabled);
|
||||
};
|
||||
Input.Player.ToggleShield.performed += context => PilotOperationAdapter.RequestShieldToggle();
|
||||
Input.Player.TargetReticle.performed += context => PilotOperationAdapter.RequestTargetReticle();
|
||||
Input.Player.TargetNearest.performed += context => PilotOperationAdapter.RequestTargetNearest();
|
||||
Input.Player.TargetNext.performed += context => PilotOperationAdapter.RequestTargetNext();
|
||||
Input.Player.TargetPrevious.performed += context => PilotOperationAdapter.RequestTargetPrevious();
|
||||
Input.Player.ToggleShield.performed += context => PilotOperationController.RequestShieldToggle();
|
||||
Input.Player.TargetReticle.performed += context => PilotOperationController.RequestTargetReticle();
|
||||
Input.Player.TargetNearest.performed += context => PilotOperationController.RequestTargetNearest();
|
||||
Input.Player.TargetNext.performed += context => PilotOperationController.RequestTargetNext();
|
||||
Input.Player.TargetPrevious.performed += context => PilotOperationController.RequestTargetPrevious();
|
||||
}
|
||||
|
||||
private void RegisterActionBarInput()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public sealed class AetheriaUnityGameplayLoopShell
|
|||
public Func<bool> IsCurrentEntityUndocked { get; set; }
|
||||
public Action ApplyLatestZoneRender { get; set; }
|
||||
public AetheriaUnityCurrentEntityPresentation CurrentEntityPresentation { get; set; }
|
||||
public AetheriaUnityPilotFrameAdapter PilotFrameAdapter { get; set; }
|
||||
public AetheriaUnityPilotFrameController PilotFrameController { get; set; }
|
||||
public AetheriaUnityTargetPresentation TargetPresentation { get; set; }
|
||||
|
||||
public void Tick(float deltaTime, float time)
|
||||
|
|
@ -22,7 +22,7 @@ public sealed class AetheriaUnityGameplayLoopShell
|
|||
ApplyLatestZoneRender?.Invoke();
|
||||
CurrentEntityPresentation?.Tick(deltaTime);
|
||||
if (IsCurrentEntityUndocked?.Invoke() == true)
|
||||
PilotFrameAdapter?.Tick(ResolveCurrentEntity?.Invoke(), deltaTime, time);
|
||||
PilotFrameController?.Tick(ResolveCurrentEntity?.Invoke(), deltaTime, time);
|
||||
}
|
||||
|
||||
public void LateTick()
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@ using UnityEngine.InputSystem;
|
|||
using UnityEngine.Rendering.PostProcessing;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
public sealed class AetheriaUnityPilotFrameAdapter
|
||||
public sealed class AetheriaUnityPilotFrameController
|
||||
{
|
||||
private float2 _entityYawPitch;
|
||||
private readonly Action<float3> _setViewDirection;
|
||||
|
||||
public AetheriaUnityPilotFrameAdapter(Action<float3> setViewDirection)
|
||||
public AetheriaUnityPilotFrameController(Action<float3> setViewDirection)
|
||||
{
|
||||
_setViewDirection = setViewDirection ?? (_ => { });
|
||||
}
|
||||
|
|
@ -6,14 +6,14 @@ using System;
|
|||
using GameCult.Aetheria.State.Verse;
|
||||
using Unity.Mathematics;
|
||||
|
||||
public sealed class AetheriaUnityPilotOperationAdapter
|
||||
public sealed class AetheriaUnityPilotOperationController
|
||||
{
|
||||
private readonly Func<AetheriaUnityPilotCommandSender> _resolvePilotCommands;
|
||||
private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
private readonly Func<float3> _resolveViewDirection;
|
||||
private readonly Func<Entity> _resolveCurrentEntity;
|
||||
|
||||
public AetheriaUnityPilotOperationAdapter(
|
||||
public AetheriaUnityPilotOperationController(
|
||||
Func<AetheriaUnityPilotCommandSender> resolvePilotCommands,
|
||||
AetheriaUnityObservedEntityIndex observedEntityIndex,
|
||||
Func<float3> resolveViewDirection,
|
||||
Loading…
Reference in a new issue