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

📄 gamescene.h

📁 游戏框架
💻 H
字号:
// ***************************************************************
//  GameScene   version:  1.0
//  -------------------------------------------------------------
//	File Name:	GameScene.h
//	Created:	2007/07/18
//	Modified:	2007/07/18   16:20
//	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_SCENE_HEAD_FILE
#define GAME_SCENE_HEAD_FILE

#pragma once

#include "FrameObject.h"

class CGameLayer;
//***************************************************************
//	场景类。提供层的组合管理,可以对一组层的公共属性进行控制。
//***************************************************************
class FRAME_COM_CLASS CGameScene :
	public CFrameObject
{
protected:
	CListTemplate<CGameLayer*, _CString>			m_lstGameLayers;			// 层列表

public:
	//构造函数
	CGameScene(void);
	//析构函数
	virtual ~CGameScene(void);

	//创建元素
	virtual CGameLayer* __cdecl Create(_CString szName, INT_PTR nPosition = LISTTEMPLATE_LAST_ITEM);
	//计算容器坐标
	virtual void __cdecl CalcContainerPosition();

	//管理模板方法
public:
	//返回层数
	virtual INT_PTR __cdecl GetLength();
	//返回层
	virtual CGameLayer* __cdecl Get(INT_PTR nIndex);
	//返回层
	virtual CGameLayer* __cdecl GetBy(LPCTSTR szKey);
	//返回层
	virtual CGameLayer* __cdecl operator[](INT_PTR nIndex);
	//返回层
	virtual CGameLayer* __cdecl operator[](LPCTSTR szKey);
	//添加层
	virtual bool __cdecl Add(CGameLayer* pGameLayer, _CString szName, INT_PTR nPosition = LISTTEMPLATE_LAST_ITEM);
	//移除层
	virtual bool __cdecl Remove(INT_PTR nIndex);
	//移除层
	virtual bool __cdecl Remove(_CString szKey);
	//移除所有对象
	virtual bool __cdecl ClearAll();
	//预渲染视图
	virtual void __cdecl PreRender(WPARAM wParam=NULL);
	//渲染层
	virtual void __cdecl Render(WPARAM wParam=NULL);
	//返回指定的路径下的对象
	IGameObject*	GetObject(_CString& szPath);
	//查找指定坐标下的对象
	bool FindObject(float x, float y, CGameScene** pGameScene, CGameLayer** pGameLayer, IGameObject** pIGameObject);
	//交换深度
	virtual void __cdecl SwitchDepth(IUnknownEx* pIObject1, IUnknownEx* pIObject2);
	//交换深度
	virtual void __cdecl SwitchDepth(IUnknownEx* pIObject, DWORD dwNewDepth);

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

#endif

⌨️ 快捷键说明

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