object.h
来自「游戏开发数据结构-Data.Structures.for.Game.Progra」· C头文件 代码 · 共 60 行
H
60 行
// ============================================================================
// Object.h
// Contains the Object base class, and related child classes.
// ============================================================================
#ifndef OBJECT_H
#define OBJECT_H
#include "SDL.h"
// ============================================================================
// Object Class
// ============================================================================
class Object
{
// =======================================================
// Data
// =======================================================
protected:
// -------------------------------------------------------
// Name: m_x, m_y
// Description: x and y coordinates of the object
// -------------------------------------------------------
int m_x, m_y;
// -------------------------------------------------------
// Name: m_cell
// Description: The cell number of the object
// -------------------------------------------------------
int m_cell;
// =======================================================
// Function
// =======================================================
public:
Object()
{
m_x = 0;
m_y = 0;
m_cell = 0;
}
int GetCell() { return m_cell; }
void SetCell( int p_cell ) { m_cell = p_cell; }
int GetX() { return m_x; }
void SetX( int p_x ) { m_x = p_x; }
int GetY() { return m_y; }
void SetY( int p_y ) { m_y = p_y; }
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?