⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gamelayouter.h

📁 游戏框架
💻 H
字号:
// ***************************************************************
//  GameLayouter   version:  1.0
//  -------------------------------------------------------------
//	File Name:	GameLayouter.h
//	Created:	2007/07/18
//	Modified:	2007/07/18   17:47
//	Author:		William.Liang
//  Msn:		lwq49@msn.com
//  Email:		lwq49@21cn.com, lwq49@msn.com
//	Description:
//
//	Purpose:	
//  -------------------------------------------------------------
//  license:
//
//  The contents of this file are subject to the Mozilla Public
//  License Version 1.1 (the "License"); you may not use this file
//  except in compliance with the License. You may obtain a copy
//  of the License at http://www.mozilla.org/MPL/ Software dis-
//  tributed under the License is distributed on an "AS IS" 
//  basis, WITHOUT WARRANTY OF ANY KIND, either express or im-
//  plied. See the License for the specific language governing
//  rights and limitations under the License.
//
//  The Initial Developer of the Original Code is William.Liang .
//  Copyright (C) 2007 - All Rights Reserved.
// ***************************************************************
#ifndef GAME_LAYOUTER_HEAD_FILE
#define GAME_LAYOUTER_HEAD_FILE

#pragma once
#include "gameframe.h"
#include "xmlparser.h"

//布局器列表
typedef CListTemplate<LPVOID, _CString>		CLPVoidList;
class CXMLParser;
//***************************************************************
//	    布局类,它是一个布局类的集合管理者。负责管理已注册的
//	布局类并根据每个XML回调结点调用所有布局处理接口逐一进行处理。
//***************************************************************
class GAME_FRAME_CLASS CGameLayouter :
	public IGameLayouter, public IGameLayouterSink
{
protected:
	LPFRAMEMANAGERHANDLE				m_lpFMHandles;				//管理句柄集合
	CLPVoidList							m_lstNodeStack;				//节点栈
	bool								m_bIsAsync;					//是否异步
	CXMLParser							m_XmlParser;				//XML解释器
	CListTemplate<IGameLayouterSink*, WORD>		m_lstLayouterSinks;	//布局接收器集合

protected:
	//IGameSection*						m_pCurrentSection;			//当前环节
	//CGameView*							m_pCurrentView;				//当前视图
	//CGameScene*							m_pCurrentScene;			//当前场景
	//CGameLayer*							m_pCurrentLayer;			//当前层

public:
	//构造函数
	CGameLayouter(LPFRAMEMANAGERHANDLE lpFMH);
	//析构函数
	virtual ~CGameLayouter(void);

public:
	//加载布局
	virtual bool __cdecl LoadLayout(_CString szFileName="OMF.xml", _CString szRoot="", bool bIsAsync=false);
	//是否异步
	virtual bool __cdecl IsAsynchronous();
	//下一结点
	virtual bool __cdecl NextNode();
	//返回结点
	virtual bool __cdecl GetNodePath(_CString szPath, LPVOID* lpParam=NULL, bool bBackwards=true);
	//校验路径
	virtual bool __cdecl ValidNodePath(_CString szPath);
	//注册回调处理器
	virtual bool __cdecl RegisterLayouterSink(IGameLayouterSink* pIGameLayouterSink);

public:
	//回调处理方法
	virtual void __cdecl Processer(_CString szNodeName, _CString szParentName, LPVOID lpParam);
	//设置上级接口
	virtual void __cdecl SetGameLayouter(IGameLayouter*	pIGameLayouter, LPFRAMEMANAGERHANDLE pFMHandles);

	//模板方法
public:
	//是否有效
	virtual bool __cdecl IsValid() { return AfxIsValidAddress(this,sizeof(CGameLayouter))?true:false;};
	//释放对象
	virtual bool __cdecl Release() { if(IsValid()) delete this; return true; };
	//接口查询
	virtual void * __cdecl QueryInterface(const IID & Guid, DWORD dwQueryVer);
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -