X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectAttackType.cpp;h=20ab7a4db4f05b90271797217940d0622553d49e;hb=4309d259becd96ead792678257e910c03a6b4a3d;hp=c41eb67bec8d39e17da1ae3abad743acdcdeb6d7;hpb=2ccc2369d32fb680a3047519d79c17de34c4e10a;p=l2e.git diff --git a/src/battle/states/SelectAttackType.cpp b/src/battle/states/SelectAttackType.cpp index c41eb67..20ab7a4 100644 --- a/src/battle/states/SelectAttackType.cpp +++ b/src/battle/states/SelectAttackType.cpp @@ -1,10 +1,3 @@ -/* - * SelectAttackType.cpp - * - * Created on: Aug 7, 2012 - * Author: holy - */ - #include "SelectAttackType.h" #include "SelectIkari.h" @@ -17,36 +10,37 @@ #include "../../app/Application.h" #include "../../app/Input.h" #include "../../common/Item.h" +#include "../../math/Vector.h" #include using app::Application; using app::Input; using common::Item; -using geometry::Vector; +using math::Vector; namespace battle { -void SelectAttackType::OnEnterState(Application &c, SDL_Surface *screen) { - ctrl = &c; +void SelectAttackType::OnEnterState(SDL_Surface *screen) { + } -void SelectAttackType::OnExitState(Application &c, SDL_Surface *screen) { - ctrl = 0; +void SelectAttackType::OnExitState(SDL_Surface *screen) { + } -void SelectAttackType::OnResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectAttackType::OnResumeState(SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(battle->GetAttackTypeMenu().Selected()); battle->NextHero(); } if (battle->AttackSelectionDone()) { // pass through - ctrl.PopState(); + Ctrl().PopState(); } } -void SelectAttackType::OnPauseState(Application &ctrl, SDL_Surface *screen) { +void SelectAttackType::OnPauseState(SDL_Surface *screen) { } @@ -86,11 +80,11 @@ void SelectAttackType::HandleEvents(const Input &input) { ac.Selection().SetSingle(); } ac.Selection().Reset(); - ctrl->PushState(new SelectTarget(battle, this, &ac.Selection(), battle->Res().weaponTargetCursor)); + Ctrl().PushState(new SelectTarget(battle, this, &ac.Selection(), battle->Res().weaponTargetCursor)); break; case AttackChoice::MAGIC: if (battle->ActiveHero().CanUseMagic()) { - ctrl->PushState(new SelectSpell(battle, this)); + Ctrl().PushState(new SelectSpell(battle, this)); } break; case AttackChoice::DEFEND: @@ -98,10 +92,10 @@ void SelectAttackType::HandleEvents(const Input &input) { battle->NextHero(); break; case AttackChoice::IKARI: - ctrl->PushState(new SelectIkari(battle, this)); + Ctrl().PushState(new SelectIkari(battle, this)); break; case AttackChoice::ITEM: - ctrl->PushState(new SelectItem(battle, this)); + Ctrl().PushState(new SelectItem(battle, this)); break; default: throw std::logic_error("selected invalid attack type"); @@ -110,18 +104,18 @@ void SelectAttackType::HandleEvents(const Input &input) { ac.Reset(); battle->PreviousHero(); if (battle->BeforeFirstHero()) { - ctrl->ChangeState(new SelectMoveAction(battle)); + Ctrl().ChangeState(new SelectMoveAction(battle)); } else { battle->ActiveHero().GetAttackChoice().Reset(); } } if (battle->AttackSelectionDone()) { - ctrl->PopState(); + Ctrl().PopState(); } } -void SelectAttackType::UpdateWorld(float deltaT) { +void SelectAttackType::UpdateWorld(Uint32 deltaT) { }