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

📄 frameobject.h

📁 游戏框架
💻 H
字号:
// ***************************************************************
//  FrameObject   version:  1.0
//  -------------------------------------------------------------
//	File Name:	FrameObject.h
//	Created:	2007/07/18
//	Modified:	2007/07/18   16:32
//	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.
// ***************************************************************
#pragma once
#include "framecom.h"

//***************************************************************
//	
//***************************************************************
class FRAME_COM_CLASS CFrameObject :
	public IFrameObject, public IBaseObject
{
protected:
	IUnknownEx*			m_pParent;					//父对象
	BASALINFO			m_BasalInfo;				//基本资料
	TCHAR				m_szName[MAX_NAME];			//对象名称
	enGameObjectType	m_enGameType;				//对象类型

	//缓冲变量
protected:
	WORD				m_wCacheType;
	bool				m_bChanged;

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

	//扩展方法
public:
	//设置父对象
	virtual void __cdecl SetParent(IUnknownEx* pIUnknownEx);
	//返回父对象
	virtual IUnknownEx* __cdecl GetParent();
	////对象创建
	//virtual bool __cdecl Create(LPCTSTR lpName, _SIZE siSize, enGameObjectType enType, ...);

	//坐标相关
public:
	//移动对象
	virtual void __cdecl MoveTo(_POINT piPoint);
	// 返回对象坐标相对于屏幕
	virtual _POINT __cdecl GetScreenPosition();
	// 返回对象相对于容器的坐标
	virtual _POINT __cdecl GetLocalPosition();
	// 返回对象容器坐标
	virtual _POINT __cdecl GetContainerPosition();
	//返回中心点
	virtual _POINT __cdecl GetAnchorPosition();
	//计算容器坐标
	virtual void __cdecl CalcContainerPosition();
	//屏幕坐标转本地坐标
	virtual _POINT __cdecl ScreenToLocal(_POINT piScreen);
	//本地坐标转屏幕坐标
	virtual _POINT __cdecl LocalToScreen(_POINT piLocal);

	//共通方法
public:
	//设置名字
	virtual void __cdecl SetObjectName(LPCTSTR lpName);
	//获取名字
	virtual LPCTSTR __cdecl GetObjectName();
	//设置类型
	virtual void __cdecl SetObjectType(enGameObjectType enGameObjectType);
	//返回类型
	virtual enGameObjectType __cdecl GetObjectType();
	//设置缓冲类型
	virtual void __cdecl SetCacheType(WORD wType);
	//返回缓冲类型
	virtual WORD __cdecl GetCacheType();
	//通知变动
	virtual void __cdecl NotifiyChange();
	//设置可视
	virtual void __cdecl SetVisabled(bool bFlag);
	//设置禁用
	virtual void __cdecl SetDisabled(bool bFlag);
	//是否可视
	virtual bool __cdecl IsVisabled();
	//是否禁用
	virtual bool __cdecl IsDisabled();
	//返回深度
	virtual DWORD __cdecl GetDepth();
	//设置深度
	virtual void __cdecl SetDepth(DWORD dwDepth);
	//设置中心
	virtual void __cdecl SetAnchorPosition(_POINT piPoint);
	//返回大小
	virtual void __cdecl SetSize(_SIZE siSize);
	//返回大小
	virtual _SIZE __cdecl GetSize();
	//返回基本信息
	virtual BASALINFO& __cdecl GetBasalInfo();
	//交换深度
	virtual void __cdecl SwitchDepth(IUnknownEx* pIObject1, IUnknownEx* pIObject2){ return; };
	//交换深度
	virtual void __cdecl SwitchDepth(IUnknownEx* pIObject, DWORD dwNewDepth){ return; };
	//渲染场景
	virtual void __cdecl Render(WPARAM wParam=NULL);
	//预渲染
	virtual void __cdecl PreRender(WPARAM wParam=NULL){};

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

⌨️ 快捷键说明

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