X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FSelectItem.cpp;h=2a90b0336a32417233ce769cd9f33b164ddde05c;hb=4309d259becd96ead792678257e910c03a6b4a3d;hp=e0f6aebe4736e5ed3a9a156379668a3570136e5d;hpb=70641f2eb3f9fce8c89dcbf345e202050609a142;p=l2e.git diff --git a/src/battle/states/SelectItem.cpp b/src/battle/states/SelectItem.cpp index e0f6aeb..2a90b03 100644 --- a/src/battle/states/SelectItem.cpp +++ b/src/battle/states/SelectItem.cpp @@ -1,10 +1,3 @@ -/* - * SelectItem.cpp - * - * Created on: Aug 9, 2012 - * Author: holy - */ - #include "SelectItem.h" #include "SelectAttackType.h" @@ -14,37 +7,38 @@ #include "../../app/Input.h" #include "../../common/Item.h" #include "../../graphics/Frame.h" +#include "../../math/Vector.h" using app::Application; using app::Input; using common::Item; -using geometry::Vector; +using math::Vector; using graphics::Frame; namespace battle { -void SelectItem::EnterState(Application &c, SDL_Surface *screen) { - ctrl = &c; +void SelectItem::OnEnterState(SDL_Surface *screen) { + } -void SelectItem::ExitState(Application &c, SDL_Surface *screen) { - ctrl = 0; +void SelectItem::OnExitState(SDL_Surface *screen) { + } -void SelectItem::ResumeState(Application &ctrl, SDL_Surface *screen) { +void SelectItem::OnResumeState(SDL_Surface *screen) { if (battle->ActiveHero().GetAttackChoice().Selection().HasSelected()) { battle->ActiveHero().GetAttackChoice().SetType(AttackChoice::ITEM); battle->ActiveHero().GetAttackChoice().SetItem(battle->ItemMenu().Selected()); - ctrl.PopState(); + Ctrl().PopState(); } } -void SelectItem::PauseState(Application &ctrl, SDL_Surface *screen) { +void SelectItem::OnPauseState(SDL_Surface *screen) { } -void SelectItem::Resize(int width, int height) { +void SelectItem::OnResize(int width, int height) { } @@ -64,19 +58,19 @@ void SelectItem::HandleEvents(const Input &input) { ac.SetType(AttackChoice::ITEM); ac.SetItem(item); battle->NextHero(); - ctrl->PopState(); + Ctrl().PopState(); } else { if (item->GetTargetingMode().TargetsSingle()) { ac.Selection().SetSingle(); } else { ac.Selection().SetMultiple(); } - ctrl->PushState(new SelectTarget(battle, parent, &ac.Selection(), battle->Res().itemTargetCursor)); + Ctrl().PushState(new SelectTarget(battle, parent, &ac.Selection(), battle->Res().itemTargetCursor)); } } } if (input.JustPressed(Input::ACTION_B)) { - ctrl->PopState(); // return control to parent + Ctrl().PopState(); // return control to parent } if (input.JustPressed(Input::PAD_UP)) { battle->ItemMenu().PreviousRow(); @@ -92,7 +86,7 @@ void SelectItem::HandleEvents(const Input &input) { } } -void SelectItem::UpdateWorld(float deltaT) { +void SelectItem::UpdateWorld(Uint32 deltaT) { }