diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-17 21:45:07 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-17 21:45:07 -0300 |
| commit | 240156765d88db25dd092fc320005cdb5f28d7a7 (patch) | |
| tree | 2fadb2e7ef9409744f1d086f8f81771a46de2957 /scripts/actors/actions/MovementAction.cs | |
| parent | e9701f8ca459fa0015d78cacdc61aee904675598 (diff) | |
Refactor no sistema de ações
Diffstat (limited to 'scripts/actors/actions/MovementAction.cs')
| -rw-r--r-- | scripts/actors/actions/MovementAction.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/actors/actions/MovementAction.cs b/scripts/actors/actions/MovementAction.cs index 3b203ca..c9474b0 100644 --- a/scripts/actors/actions/MovementAction.cs +++ b/scripts/actors/actions/MovementAction.cs @@ -3,17 +3,17 @@ using System; public partial class MovementAction : DirectionalAction { - public MovementAction(Vector2I offset) : base(offset) + public MovementAction(Actor actor, Vector2I offset) : base(actor, offset) { } - public override void Perform(Game game, Actor actor) + public override void Perform() { Vector2I finalDestination = actor.GridPosition + Offset; - if (!game.Map.IsTileWalkable(finalDestination)) return; + if (!Map.IsTileWalkable(finalDestination)) return; - if (game.Map.GetBlockingActorAtPosition(finalDestination) != null) return; + if (GetBlockingActorAtPosition(finalDestination) != null) return; actor.Walk(Offset); } |
