📄 gamelayer.h
字号:
// ***************************************************************
// GameLayer version: 1.0
// -------------------------------------------------------------
// File Name: GameLayer.h
// Created: 2007/07/18
// Modified: 2007/07/18 16:27
// 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_LAYER_HEAD_FILE
#define GAME_LAYER_HEAD_FILE
#pragma once
#include "FrameObject.h"
class CGameScene;
//***************************************************************
//
//***************************************************************
class FRAME_COM_CLASS CGameLayer :
public CFrameObject
{
protected:
CListTemplate<IGameObject*, _CString> m_lstGameObjects; // 对象列表
//缓冲变量
protected:
CGameBufferPage* m_pBufferPage;
public:
//构造函数
CGameLayer();
//析构函数
virtual ~CGameLayer(void);
//计算容器坐标
virtual void __cdecl CalcContainerPosition();
//交换深度
virtual void __cdecl SwitchDepth(IUnknownEx* pIObject1, IUnknownEx* pIObject2);
//交换深度
virtual void __cdecl SwitchDepth(IUnknownEx* pIObject, DWORD dwNewDepth);
//管理模板方法
public:
//对象个数
virtual INT_PTR __cdecl GetLength();
//返回对象
virtual IGameObject* __cdecl Get(INT_PTR nIndex);
//返回对象
virtual IGameObject* __cdecl GetBy(LPCTSTR szKey);
//返回对象
virtual IGameObject* __cdecl operator[](INT_PTR nIndex);
//返回对象
virtual IGameObject* __cdecl operator[](LPCTSTR szKey);
//添加对象
virtual bool __cdecl Add(IGameObject* pIGameObject, _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);
//设置缓冲类型
virtual void __cdecl SetCacheType(WORD wType);
//查找指定坐标下的对象
bool FindObject(float x, float y, CGameScene** pGameScene, CGameLayer** pGameLayer, IGameObject** pIGameObject);
//模板方法
public:
//是否有效
virtual bool __cdecl IsValid() { return AfxIsValidAddress(this,sizeof(CGameLayer))?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 + -