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

📄 gamegroup.h

📁 游戏框架
💻 H
字号:
// ***************************************************************
//  GameGroup   version:  1.0
//  -------------------------------------------------------------
//	File Name:	GameGroup.h
//	Created:	2007/07/18
//	Modified:	2007/07/18   15:14
//	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_GROUP_HEAD_FILE
#define GAME_GROUP_HEAD_FILE

#pragma once

#include "ObjectCom.h"
#include "GameObject.h"
//***************************************************************
//	组对象,对象扩展的基础,能将多种不同性质的对象组合为新的对
//	象,并对其进行管理和处理。
//***************************************************************
class OBJECT_COM_CLASS CGameGroup :
	public CGameObject
{
protected:
	//对象列表
	CListTemplate<IGameObject*, _CString>		m_lstGameObjects;

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

	//扩展方法
public:
	////设置父对象
	//virtual void __cdecl SetParent(IUnknownEx* pIUnknownEx){ return; };
	//返回父对象
	virtual IUnknownEx* __cdecl GetParent(){ return NULL; };

	//坐标相关
public:
	//移动对象
	virtual void __cdecl MoveTo(_POINT piPoint);
	//移动对象
	virtual void __cdecl MoveToOffset(_POINT piPoint);
	//计算容器坐标
	virtual void __cdecl CalcContainerPosition();

	//共通属性
public:
	//设置名字
	virtual void __cdecl SetObjectName(LPCTSTR lpName);
	//获取名字
	virtual LPCTSTR __cdecl GetObjectName();
	//对象创建
	virtual bool __cdecl Create(LPCTSTR lpName, _SIZE siSize, enGameObjectType enType, ...);
	//设置可视
	virtual void __cdecl SetVisabled(bool bFlag);
	//设置禁用
	virtual void __cdecl SetDisabled(bool bFlag);
	//设置点击
	virtual void __cdecl SetClickabled(bool bFlag);
	//设置角度
	virtual void __cdecl SetAngle(float fAngle);
	//设置角度
	virtual void __cdecl SetAngleOffset(float fAngle);
	//设置透明
	virtual void __cdecl SetAlpha(WORD wAlpha);
	//设置透明
	virtual void __cdecl SetAlphaOffset(WORD wAlpha);
	//设置Z空间
	virtual void __cdecl SetZ(WORD wZ);
	//设置Z空间
	virtual void __cdecl SetZOffset(WORD wZ);
	//设置缩放
	virtual void __cdecl SetScaling(_SIZE siSize);
	//设置缩放
	virtual void __cdecl SetScalingOffset(_SIZE siSize);
	//设置深度
	virtual void __cdecl SetDepth(DWORD dwDepth);
	//设置中心
	virtual void __cdecl SetAnchorPosition(_POINT piPoint);
	//设置中心
	virtual void __cdecl SetAnchorPositionOffset(_POINT piPoint);

	//管理模板方法
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 RemoveAll();				//Randy 8月23日

	//渲染场景
	virtual void __cdecl Render(WPARAM wParam=NULL);

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

⌨️ 快捷键说明

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