X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectMoveAction.cpp;h=bb7148727d77246e250d362fe323e19d6c639373;hb=3f8fac16c7ae2cbe7da47b98aba9b558825723e7;hp=7eb8fbeb1a8d98b860e692c12edaad6fc7d53cdc;hpb=8f6a2452408f4ae35396cd7008a6fab0ecb03a46;p=l2e.git diff --git a/src/battle/states/SelectMoveAction.cpp b/src/battle/states/SelectMoveAction.cpp index 7eb8fbe..bb71487 100644 --- a/src/battle/states/SelectMoveAction.cpp +++ b/src/battle/states/SelectMoveAction.cpp @@ -14,33 +14,31 @@ #include "../MoveMenu.h" #include "../../app/Application.h" #include "../../app/Input.h" -#include "../../geometry/operators.h" using app::Application; using app::Input; -using geometry::Point; using geometry::Vector; namespace battle { -void SelectMoveAction::EnterState(Application &c, SDL_Surface *screen) { - ctrl = &c; +void SelectMoveAction::OnEnterState(Application &c, SDL_Surface *screen) { + } -void SelectMoveAction::ExitState(Application &c, SDL_Surface *screen) { - ctrl = 0; +void SelectMoveAction::OnExitState(Application &c, SDL_Surface *screen) { + } -void SelectMoveAction::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectMoveAction::OnResumeState(Application &ctrl, SDL_Surface *screen) { } -void SelectMoveAction::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectMoveAction::OnPauseState(Application &ctrl, SDL_Surface *screen) { } -void SelectMoveAction::Resize(int width, int height) { +void SelectMoveAction::OnResize(int width, int height) { } @@ -57,14 +55,14 @@ void SelectMoveAction::HandleEvents(const Input &input) { if (input.JustPressed(Input::ACTION_A)) { switch (battle->GetMoveMenu().Selected()) { case MoveMenu::ATTACK: - ctrl->ChangeState(new SelectAttackType(battle)); + Ctrl().ChangeState(new SelectAttackType(battle)); battle->NextHero(); break; case MoveMenu::CHANGE: - ctrl->PushState(new SwapHeroes(battle, this)); + Ctrl().PushState(new SwapHeroes(battle, this)); break; case MoveMenu::RUN: - ctrl->ChangeState(new RunState(battle)); + Ctrl().ChangeState(new RunState(battle)); break; } } @@ -83,7 +81,7 @@ void SelectMoveAction::Render(SDL_Surface *screen) { } void SelectMoveAction::RenderMenu(SDL_Surface *screen, const Vector &offset) { - Point position( + Vector position( (battle->Width() - battle->GetMoveMenu().Width()) / 2, battle->Height() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2); battle->GetMoveMenu().Render(screen, position + offset);