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

📄 arena.h

📁 with vxworks we can develope a group of control software for industry.
💻 H
字号:
/*    BladeMaster 2, a text, rougelike(kinda), arena combat simulation game.   Copyright (C) 2002 Blademaster 2 Team, see CREDITS   Clone of BladeMaster by Logicom, Inc. Copyright(C) 1990/1993   In no means affliated with the original Blademaster or the original   Blademaster creators/programmers.   This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2 of the License, or   (at your option) any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.      You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   Useful contact information:       Website: blademaster2.sourceforge.net       Project page: www.sf.net/projects/blademaster2/   Project Lead (see CREDITS for other members of the developement team)       E-Mail: ilswyn@users.sourceforge.net       AIM: ilswyn*/#ifndef ARENA_H#define ARENA_Henum ArenaDirection{ NORTH, NORTH_EAST, EAST, SOUTH_EAST,		     SOUTH, SOUTH_WEST, WEST, NORTH_WEST };// Pair of coordinates that make up a positionclass Position { public:  Position();  ~Position();    //getters  int getPos_X() const { return x; }  int getPos_Y() const { return y; }  //setters  void setPos_X(int data) { x = data; }  void setPos_Y(int data) { y = data; }  Position& operator=(const Position& right);  friend int operator==(const Position& left, const Position& right); protected:  int x, y;};class ArenaObject{ public:  ArenaObject();  ~ArenaObject();  //  virtual void take_turn() = 0;  void draw();  void take_turn();  int check_collision(Position);  int in_arena_boundary(Position);  //Getters  Position getObjPos()const { return obj_pos; }  Position getObjLastPos()const { return obj_last_pos; }  const char* getName()const { return name.c_str(); }  int getExpValue()const { return exp_value; }  int getCurrentHealth()const { return current_health; }  int getArmorClass()const { return armor_class; }  char getObjectChar()const { return obj_char; }  int getMaxHealth()const { return max_health; }  //Setters  void setArmorClass(int data) { armor_class = data; }  void setCurrentHealth(int data) { current_health = data; }  void setExpValue(int data) { exp_value = data; }  void setObjLastPos(int tempX, int tempY);  void setObjPos(int tempX, int tempY);  void setObjChar(char data) { obj_char = data; }  void setMaxHealth(int data) { max_health; } protected:  Position obj_pos;  Position obj_last_pos;  string name;  char obj_char;  int current_health;  int max_health;  int exp_value;  int armor_class; };class Arena{ public:    ArenaObject* get_nearest_type(Position, int);    Position closest_to(Position, Position, Position);};#endif

⌨️ 快捷键说明

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