]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/states/SelectMoveAction.cpp
removed useless comments
[l2e.git] / src / battle / states / SelectMoveAction.cpp
index de8e97b4db066fca0b316cfcc767094470f8bc89..d7898742be336598aec7946c4ea9e4badaa2373a 100644 (file)
@@ -1,50 +1,43 @@
-/*
- * SelectMoveAction.cpp
- *
- *  Created on: Aug 7, 2012
- *      Author: holy
- */
-
 #include "SelectMoveAction.h"
 
+#include "RunState.h"
 #include "SelectAttackType.h"
 #include "SwapHeroes.h"
 #include "../BattleState.h"
 #include "../MoveMenu.h"
 #include "../../app/Application.h"
 #include "../../app/Input.h"
-#include "../../geometry/operators.h"
+#include "../../math/Vector.h"
 
 using app::Application;
 using app::Input;
-using geometry::Point;
-using geometry::Vector;
+using math::Vector;
 
 namespace battle {
 
-void SelectMoveAction::EnterState(Application &c, SDL_Surface *screen) {
-       ctrl = &c;
+void SelectMoveAction::OnEnterState(SDL_Surface *screen) {
+
 }
 
-void SelectMoveAction::ExitState(Application &c, SDL_Surface *screen) {
-       ctrl = 0;
+void SelectMoveAction::OnExitState(SDL_Surface *screen) {
+
 }
 
-void SelectMoveAction::ResumeState(Application &ctrl, SDL_Surface *screen) {
+void SelectMoveAction::OnResumeState(SDL_Surface *screen) {
 
 }
 
-void SelectMoveAction::PauseState(Application &ctrl, SDL_Surface *screen) {
+void SelectMoveAction::OnPauseState(SDL_Surface *screen) {
 
 }
 
 
-void SelectMoveAction::Resize(int width, int height) {
+void SelectMoveAction::OnResize(int width, int height) {
 
 }
 
 
-void SelectMoveAction::HandleInput(const Input &input) {
+void SelectMoveAction::HandleEvents(const Input &input) {
        if (input.IsDown(Input::PAD_UP)) {
                battle->GetMoveMenu().Select(MoveMenu::CHANGE);
        } else if (input.IsDown(Input::PAD_DOWN)) {
@@ -56,20 +49,20 @@ void SelectMoveAction::HandleInput(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:
-                               // TODO: switch to run state
+                               Ctrl().ChangeState(new RunState(battle));
                                break;
                }
        }
 }
 
-void SelectMoveAction::UpdateWorld(float deltaT) {
+void SelectMoveAction::UpdateWorld(Uint32 deltaT) {
 
 }
 
@@ -82,9 +75,9 @@ void SelectMoveAction::Render(SDL_Surface *screen) {
 }
 
 void SelectMoveAction::RenderMenu(SDL_Surface *screen, const Vector<int> &offset) {
-       Point<int> position(
-                       (battle->BackgroundWidth() - battle->GetMoveMenu().Width()) / 2,
-                       battle->BackgroundHeight() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2);
+       Vector<int> position(
+                       (battle->Width() - battle->GetMoveMenu().Width()) / 2,
+                       battle->Height() - battle->GetMoveMenu().Height() - battle->GetMoveMenu().Height() / 2);
        battle->GetMoveMenu().Render(screen, position + offset);
 }