/*
 * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
 */
package kr.co.zumo.app.lifeplus.view.presenter;

import kr.co.zumo.app.lifeplus.model.MainModel;
import kr.co.zumo.app.lifeplus.supervisor.ScreenID;
import kr.co.zumo.app.lifeplus.view.Event;
import kr.co.zumo.app.lifeplus.view.IMainView;
import kr.co.zumo.app.lifeplus.view.command.ActivityChangeCommand;
import kr.co.zumo.app.lifeplus.view.command.ExitCommand;

/**
 * MainPresenter
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018. 9. 21.]   [최초 작성]
 * @since 2018. 9. 21.
 */
public class MainPresenter extends Presenter<MainModel, IMainView> {

  public MainPresenter(MainModel model, IMainView view) {
    super(model, view);
  }

  @Override
  public void start() {
  }

  @Override
  protected void onDispose() {
  }

  @Override
  public boolean onBackPressed() {
    /*
     첫 화면에서는 종료;
     */
    onCommand(new ExitCommand());
    return true;
  }

  @Override
  protected void performOnEvent(Event event) {
    switch (event.getEventId()) {
      case Event.LOGIN:
        view.showPinDialog();
        break;
      case Event.SIGN_UP:
        onCommand(new ActivityChangeCommand(ScreenID.ACTIVITY_SIGN_UP, ScreenID.DIRECTION_NEXT));
        break;
      default:
        break;
    }
  }
}
