//@STATE=嶌惉拞
//@DESCRIPTION ---------------------------------------------------------------
//	MainApp 傾僾儕働乕僔儑儞儊僀儞
//  丂aMain偺嬶徾僋儔僗偱偡丅
//	棜楌:
// $Log: MainApp.cpp,v $
// Revision 1.1  2001/10/28 21:40:36  fujiwara
// DLL偵暘妱
//
// Revision 1.5  2001/07/09 20:30:09  fujiwara
// 椺奜張棟偺慻傒崬傒
//
// Revision 1.4  2001/07/01 21:30:34  fujiwara
// 儊儌儕儕乕僋僠僃僢僋尒捈偟
//
// Revision 1.3  2001/07/01 01:03:44  fujiwara
// const 偺尒捈偟
// 攝抲僄僨傿僞偼搑拞宱夁
//
// Revision 1.2  2001/05/12 00:49:43  fujiwara
// 俠倁俽傪摫擖偟丄儘僌昞帵傪捛壛
//
//	2001/01/29 儊儌儕乕儕乕僋専弌梡儔僀僽儔儕偺捛壛 
//@DESCRIPTION_END -----------------------------------------------------------
//@AUTHOR=S.F.
// Copyright (C) 2000 Satoshi Fujiwara. All Rights Reserved.
///////////////////////////////////////////////////////////////////////////////
#pragma warning( disable : 4786 )	//STL偺寈崘奜偟
// 儊儌儕乕儕乕僋専弌梡
#include "sf.h"
#include "sfdebug.h"

// SYSTEM INCLUDES
//

#include <stdio.h>
#include <list>
#include <vector>
#include <fstream>

// PROJECT INCLUDES
//
#include "exception.h"
#include "singleton.h"
#include "System.h"
#include "Console.h"
#include "Sound.h"
#include "input.h"
#include "Scene.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

#include "MainApp.h"
#include "Manager.h"
#include "s2001.h"

using namespace sf::application;
using namespace sf::system;

IMPLEMENT_SINGLETON(MainImpl,MainImpl)

// 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅
// MainFactory僋儔僗 
// 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅
Main * Main::instance()
{
	return MainImpl::instance();
}

// 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅
// MainImpl僋儔僗 
// 亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅亅

// 僐儞僗僩儔僋僞 -------------------------------------------------------------
MainImpl::MainImpl()
{
	mpSpriteBlank = NULL;

}

// 僨僗僩儔僋僞 ---------------------------------------------------------------
MainImpl::~MainImpl()
{
	if(mpSpriteBlank)
		delete mpSpriteBlank;

}// ~MainImpl()

// 弶婜壔 ---------------------------------------------------------------------
void MainImpl::initialize(void)
{
//	mState = INITIALIZE;

	mpSystem = system::instance();
	mpConsole = mpSystem->console();
	mpSound = mpSystem->sound();

	// 僽儔儞僋 僗僾儔僀僩偺儘乕僪
	console::sprite::Info brank_info = 
	{"media\\blank.bmp",0.0f,0.0f,0x0,console::sprite::SPRITE2D};
	
	if(NULL == (mpSpriteBlank = mpConsole->createSprite(&brank_info)))
		return;

	::createScene(scene::AUTHOR);

}// intialize()

// 儊僀儞偺幚峴 ---------------------------------------------------------------
void MainImpl::run()
{	// 僔乕儞偺幚峴
	scene::Container::instance()->move();
	scene::Container::instance()->eraseNull();
}// run()

