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

📄 object.h

📁 游戏开发数据结构Data Structures for Game Programmers
💻 H
字号:
// ============================================================================
// 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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -