/*
 * Copyright (C) 2022 - 2025. Henrik Bærbak Christensen, Aarhus University.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package hotstone.doubles;

import hotstone.framework.Player;
import hotstone.view.core.HotStoneDrawingView;
import minidraw.framework.Drawing;
import minidraw.framework.DrawingEditor;
import minidraw.framework.DrawingView;
import minidraw.framework.Factory;
import minidraw.standard.CompositionalDrawing;

import javax.swing.*;

/** A minidraw factory which provides simple delegates, only
 * the 'drawing view' is hotstone specific, the 'drawing' delegate
 * is just the default MiniDraw implementation, and does thus
 * not observe the game nor can take any drawing actions.
 *
 * Used in the visual tests to provide a minidraw context for
 * simple figure demonstrations.
 * */
public class SimpleViewFactory implements Factory {
  @Override
  public DrawingView createDrawingView(DrawingEditor editor) {

    return new HotStoneDrawingView(editor, Player.FINDUS);
  }

  @Override
  public Drawing createDrawing(DrawingEditor editor) {
    return new CompositionalDrawing();
  }

  @Override
  public JTextField createStatusField(DrawingEditor editor) {
    return null;
  }
}
