package com.Tutorial 
{
    import com.adamatomic.flixel.*;
	
	/**
	 * ...
	 * @author Stephen Lavelle
	 */
	public class InspectState extends FlxState
	{ 
	    [Embed(source = '../../data/gfx/frame.png')] static public var GfxSmallFrame:Class;
	    [Embed(source = '../../data/gfx/rect.png')] static public var GfxDice:Class;

		public static var showInteract:Boolean = false;
		
        public static var lyrMain:FlxLayer;

		private var _npc:NPC;
		
		public function InspectState() 
		{
			lyrMain = new FlxLayer();

			lyrMain.add(new FlxSprite(GfxSmallFrame, 14, 31));
			lyrMain.add(new FlxSprite(GfxSmallFrame, 14, 31 + 32));
			lyrMain.add(new FlxSprite(GfxDice, 14+2, 31 + 32+2));

			_npc = new NPC(16, 33, WalkState.toInspect);
			lyrMain.add(_npc);

			
			lyrMain.add(new FlxSprite(null, 0, 0, false, false, FlxG.width, 16, 0xff8d431f));
			lyrMain.add(new FlxText(32, 2, 100, 8, "INSPECT", 0xfff36f36));
			

			lyrMain.add(new FlxText(40, 37, 100, 8, _npc.ownername, 0xff8d431f));
			lyrMain.add(new FlxText(40, 64, 100, 300, _npc.description(), 0xff8d431f));
			
			
			
			this.add(lyrMain);
		}
		
		override public function update():void
		{
			if (FlxG.justPressed(FlxG.A) )
			{
				showInteract = true;
				FlxG.switchState(WalkState);
			}
			if (FlxG.justPressed(FlxG.B) )
			{
				showInteract = false;
				FlxG.switchState(WalkState);
			}
		}
	}

}