@Override
  public void Update() {
    Units.Update(10);
    switch (m_plot) {
      case 0:
        if (DBManager.getInstance().m_StringMap != null) {

          m_plot = 1;
        }
        break;
      case 1: // 배치 시작 터치 부분
        LoadMap(DBManager.getInstance().m_StringMap);
        TouchGame(x, y);
        if (AppManager.getInstance().Collusion((int) x, (int) y, r)) {
          m_plot = 2;
        }

        break;
      case 2: // 배치 완료
        saveMap();
        m_plot = 3;

        break;
      case 3:
        AppManager.getInstance().state = AppManager.S_ROBBY;
        AppManager.getInstance().getGameView().ChangeGameState(new Ready_View());
        break;
    }
  }
  @Override
  public void Render(Canvas canvas) {

    Paint paint;
    paint = new Paint();
    paint.setColor(Color.WHITE);
    canvas.drawColor(0, PorterDuff.Mode.CLEAR);
    canvas.save();
    canvas.setMatrix(matrix);
    canvas.translate(m_diffX, m_diffY);
    // 타일 한번 깔아준다.
    GraphicManager.getInstance().background.Draw(canvas, -750, -450);
    for (int i = 0; i < 50; i++) {
      for (int j = 0; j < 50; j++) {
        switch (UnitValue.m_dmap[i][j]) {
          case UnitValue.M_GRASS1:
            GraphicManager.getInstance()
                .temptile1
                .Draw(canvas, 750 + 50 / 2 * (j - i), -300 + 25 / 2 * (j + i));
            break;
          case UnitValue.M_GRASS2:
            GraphicManager.getInstance()
                .temptile2
                .Draw(canvas, 750 + 50 / 2 * (j - i), -300 + 25 / 2 * (j + i));
            break;
          case UnitValue.M_EMPTY:
            GraphicManager.getInstance()
                .temptitle3
                .Draw(canvas, 750 + 50 / 2 * (j - i), -300 + 25 / 2 * (j + i));
            break;
          case UnitValue.M_NOTMOVE:
            GraphicManager.getInstance()
                .temptile5
                .Draw(canvas, 750 + 50 / 2 * (j - i), -300 + 25 / 2 * (j + i));
            break;
        }
      }
    }
    // 나무가 타일에 겹쳐지지 않게 그려주기 위해 한번더 연산해 주었다.
    for (int i = 0; i < 50; i++) {
      for (int j = 0; j < 50; j++) {
        if (UnitValue.m_dmap[i][j] == 4) {
          GraphicManager.getInstance()
              .temptile2
              .Draw(canvas, 750 + 50 / 2 * (j - i), -300 + 25 / 2 * (j + i));
          GraphicManager.getInstance()
              .temptitle4
              .Draw(canvas, 750 + 50 / 2 * (j - i), -300 + 25 / 2 * (j + i) - 25);
        }
      }
    }

    Units.RenderUnit(canvas);
    canvas.restore();
    GraphicManager.getInstance()
        .ButtonView_Image
        .Draw(canvas, 0, (int) m_Height - (int) m_Height / 6);
    for (int i = 0; i < UI.Button.size(); i++) {
      UI.Button.get(i).Draw(canvas);
      canvas.drawText(
          "" + i, (int) (UI.Button.get(i).GetX()), (int) (UI.Button.get(i).GetY()), paint);
    }

    canvas.drawRect(m_Width / 20 * 18, 0, m_Width, m_Height / 20, paint);
  }