Skip to content

Commit

Permalink
Rename WalkErrorHandler -> UnwalkableTileActions
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed Jan 27, 2021
1 parent c89193d commit 33f01f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions EndlessClient/Controllers/ArrowKeyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ public class ArrowKeyController : IArrowKeyController
private readonly ICharacterAnimationActions _characterAnimationActions;
private readonly ICharacterActions _characterActions;
private readonly ICharacterProvider _characterProvider;
private readonly IWalkErrorHandler _walkErrorHandler;
private readonly IUnwalkableTileActions _unwalkableTileActions;
private readonly ISpikeTrapActions _spikeTrapActions;

public ArrowKeyController(IWalkValidationActions walkValidationActions,
ICharacterAnimationActions characterAnimationActions,
ICharacterActions characterActions,
ICharacterProvider characterProvider,
IWalkErrorHandler walkErrorHandler,
IUnwalkableTileActions walkErrorHandler,
ISpikeTrapActions spikeTrapActions)
{
_walkValidationActions = walkValidationActions;
_characterAnimationActions = characterAnimationActions;
_characterActions = characterActions;
_characterProvider = characterProvider;
_walkErrorHandler = walkErrorHandler;
_unwalkableTileActions = walkErrorHandler;
_spikeTrapActions = spikeTrapActions;
}

Expand Down Expand Up @@ -107,7 +107,7 @@ private void AttemptToStartWalking()
{
if (!_walkValidationActions.CanMoveToDestinationCoordinates())
{
_walkErrorHandler.HandleWalkError();
_unwalkableTileActions.HandleUnwalkableTile();
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion EndlessClient/EndlessClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<Compile Include="Input\PreviousUserInputTracker.cs" />
<Compile Include="Input\UserInputHandler.cs" />
<Compile Include="Input\UserInputHandlerFactory.cs" />
<Compile Include="Input\WalkErrorHandler.cs" />
<Compile Include="Input\UnwalkableTileActions.cs" />
<Compile Include="Old\OldCharacter.cs" />
<Compile Include="Rendering\CharacterProperties\BaseCharacterPropertyRenderer.cs" />
<Compile Include="Rendering\Character\ISpellCaster.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

namespace EndlessClient.Input
{
[MappedType(BaseType = typeof(IWalkErrorHandler))]
public class WalkErrorHandler : IWalkErrorHandler
[AutoMappedType]
public class UnwalkableTileActions : IUnwalkableTileActions
{
private readonly IMapCellStateProvider _mapCellStateProvider;
private readonly ICharacterProvider _characterProvider;
Expand All @@ -22,7 +22,7 @@ public class WalkErrorHandler : IWalkErrorHandler
private readonly IEOMessageBoxFactory _eoMessageBoxFactory;
private readonly IPacketSendService _packetSendService;

public WalkErrorHandler(IMapCellStateProvider mapCellStateProvider,
public UnwalkableTileActions(IMapCellStateProvider mapCellStateProvider,
ICharacterProvider characterProvider,
IStatusLabelSetter statusLabelSetter,
ICurrentMapStateRepository currentMapStateRepository,
Expand All @@ -39,7 +39,7 @@ public WalkErrorHandler(IMapCellStateProvider mapCellStateProvider,
_packetSendService = packetSendService;
}

public void HandleWalkError()
public void HandleUnwalkableTile()
{
var destX = MainCharacter.RenderProperties.GetDestinationX();
var destY = MainCharacter.RenderProperties.GetDestinationY();
Expand Down Expand Up @@ -167,8 +167,8 @@ private void HandleWalkToTileSpec(IMapCellState cellState)
private ICharacter MainCharacter => _characterProvider.MainCharacter;
}

public interface IWalkErrorHandler
public interface IUnwalkableTileActions
{
void HandleWalkError();
void HandleUnwalkableTile();
}
}

0 comments on commit 33f01f7

Please sign in to comment.