// This file is generated by kconfig_compiler from kspaceduel.kcfg.
// All changes you do to this file will be lost.

#include "options.h"

#include <kglobal.h>
#include <QtCore/QFile>

class OptionsHelper
{
  public:
    OptionsHelper() : q(0) {}
    ~OptionsHelper() { delete q; }
    Options *q;
};
K_GLOBAL_STATIC(OptionsHelper, s_globalOptions)
Options *Options::self()
{
  if (!s_globalOptions->q) {
    new Options;
    s_globalOptions->q->readConfig();
  }

  return s_globalOptions->q;
}

Options::Options(  )
  : KConfigSkeleton( QLatin1String( "kspaceduelrc" ) )
{
  Q_ASSERT(!s_globalOptions->q);
  s_globalOptions->q = this;
  setCurrentGroup( QLatin1String( "Game" ) );

  KConfigSkeleton::ItemDouble  *itemTimeAfterKill;
  itemTimeAfterKill = new KConfigSkeleton::ItemDouble( currentGroup(), QLatin1String( "timeAfterKill" ), mTimeAfterKill, 42.9 );
  addItem( itemTimeAfterKill, QLatin1String( "TimeAfterKill" ) );
  KConfigSkeleton::ItemInt  *itemStartHitPoints[2];
  itemStartHitPoints[0] = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "startHitPointsP0" ), mStartHitPoints[0], 99 );
  addItem( itemStartHitPoints[0], QLatin1String( "StartHitPoints0" ) );
  itemStartHitPoints[1] = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "startHitPointsP1" ), mStartHitPoints[1], 99 );
  addItem( itemStartHitPoints[1], QLatin1String( "StartHitPoints1" ) );
  KConfigSkeleton::ItemBool  *itemPlayerIsAi[2];
  itemPlayerIsAi[0] = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "player0IsAi" ), mPlayerIsAi[0], false );
  addItem( itemPlayerIsAi[0], QLatin1String( "Player0IsAi" ) );
  itemPlayerIsAi[1] = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "player1IsAi" ), mPlayerIsAi[1], true );
  addItem( itemPlayerIsAi[1], QLatin1String( "Player1IsAi" ) );
  QList<KConfigSkeleton::ItemEnum::Choice2> valuesAiDifficulty;
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("Trainee");
    valuesAiDifficulty.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("Normal");
    valuesAiDifficulty.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("Hard");
    valuesAiDifficulty.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice2 choice;
    choice.name = QLatin1String("Insane");
    valuesAiDifficulty.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemAiDifficulty[2];
  itemAiDifficulty[0] = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "ai0Difficulty" ), mAiDifficulty[0], valuesAiDifficulty, EnumAiDifficulty::Normal );
  addItem( itemAiDifficulty[0], QLatin1String( "AiDifficulty0" ) );
  itemAiDifficulty[1] = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "ai1Difficulty" ), mAiDifficulty[1], valuesAiDifficulty, EnumAiDifficulty::Normal );
  addItem( itemAiDifficulty[1], QLatin1String( "AiDifficulty1" ) );
  KConfigSkeleton::ItemInt  *itemLastConfig;
  itemLastConfig = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "lastConfig" ), mLastConfig, 0 );
  addItem( itemLastConfig, QLatin1String( "LastConfig" ) );
  KConfigSkeleton::ItemInt  *itemRefreshTime;
  itemRefreshTime = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "refreshTime" ), mRefreshTime, 33 );
  itemRefreshTime->setMinValue(10);
  itemRefreshTime->setMaxValue(100);
  addItem( itemRefreshTime, QLatin1String( "RefreshTime" ) );
}

Options::~Options()
{
  if (!s_globalOptions.isDestroyed()) {
    s_globalOptions->q = 0;
  }
}

