weapon.h

来自「一个三维打斗游戏」· C头文件 代码 · 共 42 行

H
42
字号
// (C) Copyright 1996 by Anthony J. Carin.  All Rights Reserved.
#ifndef WEAPON_H
#define WEAPON_H

#include "landscpe.h"
#include "weaphold.h"

class handheld : public landscape
{
public:
    handheld() : landscape((CString) "") { m_type = HANDHELD; }

    char IsAKnife()     { return (char) (m_hhtype == KNIFE); }
    char IsASword()     { return (char) (m_hhtype == SWORD); }
    char IsAShield()    { return (char) (m_hhtype == SHIELD); }
    short NumType()     { return (short) m_hhtype; }
    void draw();

protected:
   WeaponType m_hhtype;
   char hitfloor;
   char pickingup;
   view m_prevview;

};

class weapon : public handheld
{
public:
   weapon(CString& weapondat);
   void draw();
   void Throw(direction& dir, float speed);

private:
   char throwing;
   direction throwdir;
   float throwspeed;
   direction flipdir;
};

#endif

⌨️ 快捷键说明

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