view LightClone/Source/CodePanel.h @ 40:00d17d8f407d

Hookup game over dialog; Remove Code class
author koryspansel
date Thu, 22 Sep 2011 10:21:14 -0700
parents 2caa7c7e2cb5
children
line wrap: on
line source

/*
 * CodePanel
 */

#ifndef __CODEPANEL_H__
#define __CODEPANEL_H__

#include "Core.h"
#include "CodeSlot.h"

/*
 * ActionArguments
 */
struct ActionArguments : public GuiEventArguments
{
	/*
	 * nSlot
	 */
	uint32 nSlot;

	/*
	 * ActionArguments
	 */
	ActionArguments(GuiElement* pSource, uint32 nCodeSlot) : GuiEventArguments(pSource), nSlot(nCodeSlot)
	{
	}
};

/*
 * CodePanel
 */
class CodePanel : public GuiImage
{
public:

	/*
	 * EventAction
	 */
	static const char* EventAction;

private:

	/*
	 * pSlot
	 */
	CodeSlot* pSlot;

	/*
	 * nSizeX
	 */
	uint32 nSizeX;

	/*
	 * nSizeY
	 */
	uint32 nSizeY;

public:

	/*
	 * CodePanel
	 */
	CodePanel(uint32 nWidth, uint32 nHeight);

	/*
	 * Initialize
	 */
	virtual ErrorCode Initialize(ResourceManager* pResourceManager);

	/*
	 * SetAvailableSlots
	 */
	void SetAvailableSlots(uint32 nCount);

	/*
	 * SetAction
	 */
	void SetAction(uint32 nIndex, uint32 nAction);

	/*
	 * GetAction
	 */
	uint32 GetAction(uint32 nIndex) const;

	/*
	 * Clear
	 */
	void Clear();

	/*
	 * SetPermanent
	 */
	void SetPermanent(bool bPermanent);

private:

	/*
	 * OnActionDropped
	 */
	void OnActionDropped(GuiEventArguments& kArguments);
};

#endif //__CODEPANEL_H__