/*
 * Copyright 2017 Patrik Karlsson.
 *
 * 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 org.nbgames.yaya;

import org.nbgames.core.api.GameCategory;
import org.nbgames.core.api.GameController;
import org.nbgames.core.api.ui.GamePanel;
import org.nbgames.core.api.ui.NewGamePanel;
import org.nbgames.core.api.options.NbgOptionsPanel;
import org.openide.util.lookup.ServiceProvider;
import org.openide.util.lookup.ServiceProviders;

/**
 *
 * @author Patrik Karlsson
 */
@ServiceProviders(value = {
    @ServiceProvider(service = GameController.class)
})
public class Yaya extends GameController {

    public static final String LOG_TITLE = "Yaya";

    private YayaPanel mGamePanel;
    private OptionsPanel mOptionPanel;
    private YayaNewGamePanel mNewGamePanel;

    public Yaya() {
    }

    @Override
    public GameCategory getCategory() {
        return GameCategory.DICE;
    }

    @Override
    public String getHelp() {
        return getHelp(Yaya.class);
    }

    @Override
    public NewGamePanel getNewGamePanel() {
        if (mNewGamePanel == null) {
            mNewGamePanel = new YayaNewGamePanel();
        }

        return mNewGamePanel;
    }

    @Override
    public NbgOptionsPanel getOptionsPanel() {
        if (mOptionPanel == null) {
            mOptionPanel = new OptionsPanel();
        }

        return mOptionPanel;
    }

    @Override
    public GamePanel getPanel() {
        if (mGamePanel == null) {
            mGamePanel = new YayaPanel();
        }

        return mGamePanel;
    }

    @Override
    public void onRequestNewGameStart() {
        getPanel().newGame();
    }
}

@@ -621,16 +621,53 @@
 .yaya;%0A%0A
+import java.awt.image.BufferedImage;%0A
 import o
@@ -740,24 +740,77 @@
 Controller;%0A
+import org.nbgames.core.api.options.NbgOptionsPanel;%0A
 import org.n
@@ -888,61 +888,8 @@
 el;%0A
-import org.nbgames.core.api.options.NbgOptionsPanel;%0A
 impo
@@ -980,16 +980,165 @@
 oviders;
+%0Aimport se.trixon.almond.util.GraphicsHelper;%0Aimport se.trixon.almond.util.icons.IconColor;%0Aimport se.trixon.almond.util.icons.material.MaterialIcon;
 %0A%0A/**%0A *
@@ -1399,72 +1399,72 @@
 ate 
-OptionsPanel mOptionPanel;%0A    private YayaNewGamePanel mNewGame
+YayaNewGamePanel mNewGamePanel;%0A    private OptionsPanel mOption
 Pane
@@ -1668,32 +1668,208 @@
 .class);%0A    %7D%0A%0A
+    @Override%0A    public BufferedImage getImage() %7B%0A        return GraphicsHelper.toBufferedImage(MaterialIcon._Social.CAKE.get(96, IconColor.getDefault()).getImage());%0A    %7D%0A%0A
     @Override%0A  

Add game icon