#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"
using app::Application;
using app::Input;
-using geometry::Point;
using geometry::Vector;
namespace battle {
}
-void SelectMoveAction::HandleInput(const app::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)) {
battle->NextHero();
break;
case MoveMenu::CHANGE:
- // TODO: switch to change state
+ ctrl->PushState(new SwapHeroes(battle, this));
break;
case MoveMenu::RUN:
- // TODO: switch to run state
+ ctrl->ChangeState(new RunState(battle));
break;
}
}
}
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);
}