X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fh-type.h;h=3aa85e3de94c6d22d63789df835dcd2ef58b80d0;hb=924ccf7dec90442b9f1dc29743203792b11fdd3d;hp=af4eab8e8e0b15750ff3c6d7fadf55fb05973d0e;hpb=c7b2453c02694e8bb0588d7688fe66b64972558a;p=hengband%2Fhengband.git diff --git a/src/h-type.h b/src/h-type.h index af4eab8e8..3aa85e3de 100644 --- a/src/h-type.h +++ b/src/h-type.h @@ -1,43 +1,40 @@ -/* File: h-type.h */ - -#ifndef INCLUDED_H_TYPE_H -#define INCLUDED_H_TYPE_H - -/* +/*! + * @file h-type.h + * @brief ゲーム中に用いる変数型定義 / * Basic "types". - * + * @date 2014/08/17 + * @author + * 不明(変愚蛮怒スタッフ?) + * @details + *
  * Note the attempt to make all basic types have 4 letters.
  * This improves readibility and standardizes the code.
- *
  * Likewise, all complex types are at least 4 letters.
  * Thus, almost every three letter word is a legal variable.
  * But beware of certain reserved words ('for' and 'if' and 'do').
- *
  * Note that the type used in structures for bit flags should be uint.
  * As long as these bit flags are sequential, they will be space smart.
- *
  * Note that on some machines, apparently "signed char" is illegal.
- *
  * It must be true that char/byte takes exactly 1 byte
  * It must be true that sind/uind takes exactly 2 bytes
  * It must be true that sbig/ubig takes exactly 4 bytes
- *
  * On Sparc's, a sint takes 4 bytes (2 is legal)
  * On Sparc's, a uint takes 4 bytes (2 is legal)
  * On Sparc's, a long takes 4 bytes (8 is legal)
  * On Sparc's, a huge takes 4 bytes (8 is legal)
  * On Sparc's, a vptr takes 4 bytes (8 is legal)
  * On Sparc's, a real takes 8 bytes (4 is legal)
- *
  * Note that some files have already been included by "h-include.h"
  * These include  and , which define some types
  * In particular, uint is defined so we do not have to define it
- *
  * Also, see  for min/max values for sind, uind, long, huge
  * (SHRT_MIN, SHRT_MAX, USHRT_MAX, LONG_MIN, LONG_MAX, ULONG_MAX)
  * These limits should be verified and coded into "h-constant.h".
+ * 
*/ +#ifndef INCLUDED_H_TYPE_H +#define INCLUDED_H_TYPE_H #ifdef HAVE_STDINT_H #include @@ -45,46 +42,30 @@ /*** Special 4 letter names for some standard types ***/ - -/* A standard pointer (to "void" because ANSI C says so) */ -typedef void *vptr; - -/* A simple pointer (to unmodifiable strings) */ -typedef const char *cptr; - - -/* Since float's are silly, hard code real numbers as doubles */ -typedef double real; +typedef void *vptr; /*!< void型ポインタ定義 / A standard pointer (to "void" because ANSI C says so) */ +typedef const char *cptr; /*!< 文字列定数用ポインタ定義 / A simple pointer (to unmodifiable strings) */ +typedef double real; /*!< doubleをreal型として定義 / Since float's are silly, hard code real numbers as doubles */ -/* Error codes for function return values */ -/* Success = 0, Failure = -N, Problem = +N */ +/*! + * @brief エラーコードの定義 / Error codes for function return values + * @details + * 一般に成功時0、失敗時負数、何らかの問題時整数とする。 + * Success = 0, Failure = -N, Problem = +N + */ typedef int errr; - -/* - * Hack -- prevent problems with non-MACINTOSH - */ #undef uint -#define uint uint_hack +#define uint uint_hack /*!< 非マッキントッシュ環境で重複を避けるためのuint_hack型定義 / Hack -- prevent problems with non-MACINTOSH */ -/* - * Hack -- prevent problems with MSDOS and WINDOWS - */ #undef huge -#define huge huge_hack +#define huge huge_hack /*!< WINDOWS環境で重複を避けるためのhuge_hack定義 / Hack -- prevent problems with WINDOWS */ -/* - * Hack -- prevent problems with AMIGA - */ #undef byte -#define byte byte_hack +#define byte byte_hack /*!< AMIGA環境で重複を避けるためのbyte_hack定義 / Hack -- prevent problems with AMIGA */ -/* - * Hack -- prevent problems with C++ - */ #undef bool -#define bool bool_hack +#define bool bool_hack /*!< C++環境で重複を避けるためのbool_hack定義 Hack -- prevent problems with C++ */ /* Note that "signed char" is not always "defined" */ @@ -92,20 +73,10 @@ typedef int errr; /* A signed byte of memory */ /* typedef signed char syte; */ -/* Note that unsigned values can cause math problems */ -/* An unsigned byte of memory */ -typedef unsigned char byte; - -/* Note that a bool is smaller than a full "int" */ -/* Simple True/False type */ -typedef char bool; - - -/* A signed, standard integer (at least 2 bytes) */ -typedef int sint; - -/* An unsigned, "standard" integer (often pre-defined) */ -typedef unsigned int uint; +typedef unsigned char byte; /*!< byte型をunsighned charとして定義 / Note that unsigned values can cause math problems / An unsigned byte of memory */ +typedef char bool; /*!< bool型をcharとして定義 / Note that a bool is smaller than a full "int" / Simple True/False type */ +typedef int sint; /*!< sint型をintとして定義 / A signed, standard integer (at least 2 bytes) */ +typedef unsigned int uint; /* uint型をintとして定義 / An unsigned, "standard" integer (often pre-defined) */ /* The largest possible signed integer (pre-defined) */ @@ -114,7 +85,6 @@ typedef unsigned int uint; /* The largest possible unsigned integer */ typedef unsigned long huge; - /* Signed/Unsigned 16 bit value */ #ifdef HAVE_STDINT_H typedef int16_t s16b; @@ -134,7 +104,82 @@ typedef unsigned long u32b; #endif +typedef s16b IDX; /*!< ゲーム中のID型を定義 */ +typedef s16b FEAT_IDX; /*!< ゲーム中の地形ID型を定義 */ +typedef s16b MONRACE_IDX; /*!< ゲーム中のモンスター種族ID型を定義 */ +typedef s16b MONSTER_IDX; /*!< ゲーム中のモンスター個体ID型を定義 */ +typedef s16b DUNGEON_IDX; /*!< ゲーム中のダンジョンID型を定義 */ +typedef s16b REALM_IDX; /*!< ゲーム中の魔法領域ID型を定義 */ +typedef s16b ARTIFACT_IDX; /*!< ゲーム中のアーティファクトID型を定義 */ +typedef s16b VIRTUES_IDX; /*!< ゲーム中の徳ID型を定義 */ +typedef s16b QUEST_IDX; /*!< ゲーム中のクエストID型を定義 */ + +typedef s16b INVENTORY_IDX; /*!< ゲーム中の所持品ID型を定義 */ +typedef s16b OBJECT_IDX; /*!< ゲーム中のアイテムID型を定義 */ + +typedef s16b KIND_OBJECT_IDX; /*!< ゲーム中のベースアイテムID型を定義 */ + +typedef s32b POSITION; /*!< ゲーム中の座標型を定義 */ +typedef s32b HIT_POINT; /*!< ゲーム中のHP/ダメージ型を定義 */ +typedef s32b MANA_POINT; /*!< ゲーム中のMP型を定義 */ +typedef s16b HIT_PROB; /*!< ゲーム中の命中修正値を定義 */ +typedef s16b BASE_STATUS; /*!< ゲーム中の基礎能力値型を定義 */ + +typedef s32b MONSTER_NUMBER; /*!< ゲーム中のモンスター数型を定義 */ +typedef s32b ITEM_NUMBER; /*!< ゲーム中のアイテム数型を定義 */ + +typedef s16b ACTION_ENERGY; /*!< ゲーム中の行動エネルギー型を定義 */ +typedef s16b ARMOUR_CLASS; /*!< ゲーム中の行動アーマークラス型を定義 */ +typedef s16b TIME_EFFECT; /*!< ゲーム中の時限期間の型を定義 */ +typedef byte CHARACTER_IDX; /*!< ゲーム中のキャラクター特性各種IDの型を定義 */ +typedef byte DISCOUNT_RATE; /*!< ゲーム中の値引き率の型を定義 */ +typedef byte SPEED; /*!< ゲーム中の加速値の型定義 */ +typedef s16b ENERGY; /*!< ゲーム中の行動エネルギーの型定義 */ + +typedef s16b PLAYER_LEVEL; /*!< ゲーム中のプレイヤーレベルの型を定義 */ +typedef int DIRECTION; /*!< ゲーム中の方角の型定義 */ +typedef s32b EXP; /*!< ゲーム中の主経験値の型定義 */ +typedef s16b SUB_EXP; /*!< ゲーム中の副経験値の型定義 */ + +typedef s32b OBJECT_TYPE_VALUE; /*!< ゲーム中のアイテム主分類の型定義 */ +typedef s32b OBJECT_SUBTYPE_VALUE; /*!< ゲーム中のアイテム副分類の型定義 */ +typedef s16b PARAMETER_VALUE; /*!< ゲーム中のアイテム能力値の型定義 */ +typedef s16b WEIGHT; /*!< ゲーム中の重量の型定義(ポンド) */ + +typedef int DICE_NUMBER; /*!< ゲーム中のダイス数の型定義 */ +typedef int DICE_SID; /*!< ゲーム中のダイス面の型定義 */ +typedef s32b PRICE; /*!< ゲーム中の金額価値の型定義 */ +typedef s16b FEED; /*!< ゲーム中の滋養度の型定義 */ + +typedef u32b STR_OFFSET; /*!< テキストオフセットの型定義 */ + +typedef s32b DEPTH; /*!< ゲーム中の階層レベルの型定義 */ +typedef byte RARITY; /*!< ゲーム中の希少度の型定義 */ + +typedef s32b GAME_TURN; /*!< ゲーム中のターンの型定義 */ + +typedef s16b PERCENTAGE; /*!< ゲーム中のパーセント表記の型定義 */ + +typedef u32b BIT_FLAGS; /*!< 32ビットのフラグ配列の型定義 */ +typedef u16b BIT_FLAGS16; /*!< 16ビットのフラグ配列の型定義 */ +typedef byte BIT_FLAGS8; /*!< 8ビットのフラグ配列の型定義 */ + +typedef s16b XTRA16; /*!< 汎用変数16ビットの型定義 */ +typedef byte XTRA8; /*!< 汎用変数8ビットの型定義 */ + +typedef s16b COMMAND_CODE; /*!< コマンド内容の型定義 */ +typedef s16b COMMAND_ARG; /*!< コマンド引数の型定義 */ + +typedef int TERM_POSITION; /*!< コンソール表示座標の型定義 */ +typedef byte SYMBOL_COLOR; /*!< キャラの色の型定義 */ +typedef byte SYMBOL_CODE; /*!< キャラの文字の型定義 */ + +typedef s32b MAGIC_NUM1; /*!< プレイヤーの汎用魔法情報配列1の型定義*/ +typedef byte MAGIC_NUM2; /*!< プレイヤーの汎用魔法情報配列2の型定義*/ +typedef s32b SPELL_IDX; /*!< 各魔法領域/職業能力ごとの呪文ID型定義 */ +typedef s16b PROB; /*!< 確率の重みの型定義 */ +typedef byte FEAT_POWER; /*!< 地形強度の型定義 */ /*** Pointers to all the basic types defined above ***/