X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectAttackType.cpp;h=351ad1c3584337d85a4d6b4baa3bc20a7a8fc3bb;hb=65158353d1ecbed0032752863c6c4eb96b1a084a;hp=a6e288afdd306f0ea2b29e2601f419c9cc75b575;hpb=b53c2ec2621ccc654e819cb203dc26e0a482bd41;p=l2e.git diff --git a/src/battle/states/SelectAttackType.cpp b/src/battle/states/SelectAttackType.cpp index a6e288a..351ad1c 100644 --- a/src/battle/states/SelectAttackType.cpp +++ b/src/battle/states/SelectAttackType.cpp @@ -17,27 +17,25 @@ #include "../../app/Application.h" #include "../../app/Input.h" #include "../../common/Item.h" -#include "../../geometry/operators.h" #include using app::Application; using app::Input; using common::Item; -using geometry::Point; using geometry::Vector; namespace battle { -void SelectAttackType::EnterState(Application &c, SDL_Surface *screen) { +void SelectAttackType::OnEnterState(Application &c, SDL_Surface *screen) { ctrl = &c; } -void SelectAttackType::ExitState(Application &c, SDL_Surface *screen) { +void SelectAttackType::OnExitState(Application &c, SDL_Surface *screen) { ctrl = 0; } -void SelectAttackType::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectAttackType::OnResumeState(Application &ctrl, SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(battle->GetAttackTypeMenu().Selected()); battle->NextHero(); @@ -48,7 +46,7 @@ void SelectAttackType::ResumeState(Application &ctrl, SDL_Surface *screen) { } } -void SelectAttackType::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectAttackType::OnPauseState(Application &ctrl, SDL_Surface *screen) { } @@ -91,7 +89,6 @@ void SelectAttackType::HandleEvents(const Input &input) { ctrl->PushState(new SelectTarget(battle, this, &ac.Selection(), battle->Res().weaponTargetCursor)); break; case AttackChoice::MAGIC: - // TODO: detect single/multiple/all attack mode if (battle->ActiveHero().CanUseMagic()) { ctrl->PushState(new SelectSpell(battle, this)); } @@ -115,7 +112,7 @@ void SelectAttackType::HandleEvents(const Input &input) { if (battle->BeforeFirstHero()) { ctrl->ChangeState(new SelectMoveAction(battle)); } else { - ac.Reset(); + battle->ActiveHero().GetAttackChoice().Reset(); } } @@ -137,7 +134,7 @@ void SelectAttackType::Render(SDL_Surface *screen) { } void SelectAttackType::RenderMenu(SDL_Surface *screen, const Vector &offset) { - Point position( + Vector position( (battle->Width() - battle->GetAttackTypeMenu().Width()) / 2, battle->Height() - battle->GetAttackTypeMenu().Height() - battle->GetAttackTypeMenu().Height() / 2); battle->GetAttackTypeMenu().Render(screen, position + offset);