package
{
	import display.Preloader;
	import display.StateManager;
	import display.states.AboutState;
	import display.states.GameEndedState;
	import display.states.GameState;
	import display.states.MainMenuState;
	import display.states.NewWorldState;
	import display.states.SelectWorldState;
	import display.states.SettingsState;
	import display.states.TutorialState;
	import starling.events.Event;
	
	/**
	 * ...
	 * @author RedMaster
	 */
	public class Game extends StateManager
	{		
		public static var MainMenu:MainMenuState = new MainMenuState();
		public static var Playing:GameState = new GameState();
		public static var NewWorld:NewWorldState = new NewWorldState();
		public static var SelectWorld:SelectWorldState = new SelectWorldState();
		public static var GameEnded:GameEndedState = new GameEndedState();
		public static var Settings:SettingsState = new SettingsState();
		public static var About:AboutState = new AboutState();
		public static var Tutorial:TutorialState = new TutorialState();
		
		public function Game()
		{
			super();
			C.game = this;
			C.starling.addEventListener(Events.RESOURCES_LOADED, init);
		}
		
		private function init(e:Event):void
		{
			C.starling.nativeStage.removeChild(C.preloader);
			showState(MainMenu);
			Settings.init();
		}
	}
}