From 08f34ecf64239e7339a3cf97d759884094507a46 Mon Sep 17 00:00:00 2001 From: deskull Date: Sun, 2 Feb 2014 12:30:32 +0000 Subject: [PATCH] Add Doxygen comment to store.c. --- src/store.c | 112 ++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 79 insertions(+), 33 deletions(-) diff --git a/src/store.c b/src/store.c index 2e606ea0c..7ee20cab8 100644 --- a/src/store.c +++ b/src/store.c @@ -546,9 +546,14 @@ static cptr comment_7d[MAX_COMMENT_7D] = }; -/* +/*! + * @brief Ź¼ç¤¬¸ò¾Ä¤ò½ª¤¨¤¿ºÝ¤ÎÈ¿±þ¤òÊÖ¤¹½èÍý / * Let a shop-keeper React to a purchase - * + * @param price ¥¢¥¤¥Æ¥à¤Î¼è°ú³Û + * @param value ¥¢¥¤¥Æ¥à¤Î¼ÂºÝ²ÁÃÍ + * @param guess Ź¼ç¤¬Åö½éͽÁÛ¤·¤Æ¤¤¤¿²ÁÃÍ + * @return ¤Ê¤· + * @details * We paid "price", it was worth "value", and we thought it was worth "guess" */ static void purchase_analyze(s32b price, s32b value, s32b guess) @@ -858,25 +863,27 @@ static byte rgold_adj[MAX_RACES][MAX_RACES] = - -/* +/*! + * @brief ŹÊÞ²Á³Ê¤ò·èÄꤹ¤ë / * Determine the price of an item (qty one) in a store. - * + * @param o_ptr ŹÊÞ¤Ëʤ٤륪¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿ + * @param greed Ź¼ç¤Î¶¯ÍßÅÙ + * @param flip TRUE¤Ê¤é¤ÐŹ¼ç¤Ë¤È¤Ã¤Æ¤ÎÇã¼è²Á³Ê¡¢FALSE¤Ê¤éÇä½Ð²Á³Ê¤ò·×»» + * @return ¤Ê¤· + * @details + *
  * This function takes into account the player's charisma, and the
  * shop-keepers friendliness, and the shop-keeper's base greed, but
  * never lets a shop-keeper lose money in a transaction.
- *
  * The "greed" value should exceed 100 when the player is "buying" the
  * item, and should be less than 100 when the player is "selling" it.
- *
  * Hack -- the black market always charges twice as much as it should.
- *
  * Charisma adjustment runs from 80 to 130
  * Racial adjustment runs from 95 to 130
- *
  * Since greed/charisma/racial adjustments are centered at 100, we need
  * to adjust (by 200) to extract a usable multiplier.  Note that the
  * "greed" value is always something (?).
+ * 
*/ static s32b price_item(object_type *o_ptr, int greed, bool flip) { @@ -943,9 +950,15 @@ static s32b price_item(object_type *o_ptr, int greed, bool flip) } -/* +/*! + * @brief °Â²Á¤Ê¾ÃÌ×ÉʤÎÈÎÇä¿ô¤òÁý¤ä¤·¡¢Äã³ÎΨ¤Ç³ä°ú¤Ë¤¹¤ë / * Certain "cheap" objects should be created in "piles" + * @param o_ptr ŹÊÞ¤Ëʤ٤륪¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿ + * @return ¤Ê¤· + * @details + *
  * Some objects can be sold at a "discount" (in small piles)
+ * 
*/ static void mass_produce(object_type *o_ptr) { @@ -1116,10 +1129,16 @@ msg_print(" -/* +/*! + * @brief ŹÊÞ¤Ëʤ٤¿ÉʤòƱ°ìÉʤǤ¢¤ë¤«¤É¤¦¤«È½Äꤹ¤ë / * Determine if a store item can "absorb" another item - * + * @param o_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿1 + * @param j_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿2 + * @return Ʊ°ì°·¤¤¤Ç¤­¤ë¤Ê¤éTRUE¤òÊÖ¤¹ + * @details + *
  * See "object_similar()" for the same function for the "player"
+ * 
*/ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr) { @@ -1173,8 +1192,16 @@ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr) } -/* +/*! + * @brief ŹÊÞ¤Ëʤ٤¿Éʤò½Å¤Í¹ç¤ï¤»¤Ç¤­¤ë¤«¤É¤¦¤«È½Äꤹ¤ë / * Allow a store item to absorb another item + * @param o_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿1 + * @param j_ptr ȽÄꤹ¤ë¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿2 + * @return ½Å¤Í¹ç¤ï¤»¤Ç¤­¤ë¤Ê¤éTRUE¤òÊÖ¤¹ + * @details + *
+ * See "object_similar()" for the same function for the "player"
+ * 
*/ static void store_object_absorb(object_type *o_ptr, object_type *j_ptr) { @@ -1200,15 +1227,20 @@ static void store_object_absorb(object_type *o_ptr, object_type *j_ptr) } -/* +/*! + * @brief ŹÊÞ¤ËÉʤòÃÖ¤¯¥¹¥Ú¡¼¥¹¤¬¤¢¤ë¤«¤É¤¦¤«¤ÎȽÄê¤òÊÖ¤¹ / * Check to see if the shop will be carrying too many objects -RAK- + * @param o_ptr ŹÊÞ¤ËÃÖ¤­¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿ + * @return ÃÖ¤­¾ì¤¬¤Ê¤¤¤Ê¤é0¡¢½Å¤Í¹ç¤ï¤»¤Ç¤­¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ë¤Ê¤é-1¡¢¥¹¥Ú¡¼¥¹¤¬¤¢¤ë¤Ê¤é1¤òÊÖ¤¹¡£ + * @details + *
  * Note that the shop, just like a player, will not accept things
  * it cannot hold.	Before, one could "nuke" potions this way.
- *
  * Return value is now int:
  *  0 : No space
  * -1 : Can be combined to existing slot.
  *  1 : Cannot be combined but there are empty spaces.
+ * 
*/ static int store_check_num(object_type *o_ptr) { @@ -1287,7 +1319,11 @@ static int store_check_num(object_type *o_ptr) return 0; } - +/*! + * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬½ËÊ¡¤µ¤ì¤Æ¤¤¤ë¤«¤ÎȽÄê¤òÊÖ¤¹ / + * @param o_ptr ȽÄꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿ + * @return ¥¢¥¤¥Æ¥à¤¬½ËÊ¡¤µ¤ì¤¿¥¢¥¤¥Æ¥à¤Ê¤é¤ÐTRUE¤òÊÖ¤¹ + */ static bool is_blessed(object_type *o_ptr) { u32b flgs[TR_FLAG_SIZE]; @@ -1298,9 +1334,12 @@ static bool is_blessed(object_type *o_ptr) -/* +/*! + * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤¬½êÄê¤ÎŹÊޤǰú¤­¼è¤ì¤ë¤«¤É¤¦¤«¤òÊÖ¤¹ / * Determine if the current store will purchase the given item - * + * @param o_ptr ȽÄꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿ + * @return ¥¢¥¤¥Æ¥à¤¬Ç㤤¼è¤ì¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹ + * @note * Note that a shop-keeper must refuse to buy "worthless" items */ static bool store_will_buy(object_type *o_ptr) @@ -1517,8 +1556,11 @@ static bool store_will_buy(object_type *o_ptr) } -/* - * Combine and reorder items in the home +/*! + * @brief ¸½ºß¤ÎÄ®¤Î»ØÄꤵ¤ì¤¿Å¹ÊޤΥ¢¥¤¥Æ¥à¤òÀ°Íý¤¹¤ë / + * Combine and reorder items in store. + * @param store_num ŹÊÞID + * @return ¼ÂºÝ¤ËÀ°Íý¤¬¹Ô¤ï¤ì¤¿¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£ */ bool combine_and_reorder_home(int store_num) { @@ -1677,15 +1719,18 @@ bool combine_and_reorder_home(int store_num) } -/* +/*! + * @brief ²æ¤¬²È¤Ë¥ª¥Ö¥¸¥§¥¯¥È¤ò²Ã¤¨¤ë / * Add the item "o_ptr" to the inventory of the "Home" - * + * @param o_ptr ²Ã¤¨¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿ + * @return ¼ý¤á¤¿Àè¤ÎID + * @details + *
  * In all cases, return the slot (or -1) where the object was placed
- *
  * Note that this is a hacked up version of "inven_carry()".
- *
  * Also note that it may not correctly "adapt" to "knowledge" bacoming
  * known, the player may have to pick stuff up and drop it again.
+ * 
*/ static int home_carry(object_type *o_ptr) { @@ -1779,17 +1824,18 @@ static int home_carry(object_type *o_ptr) } -/* +/*! + * @brief ŹÊޤ˥ª¥Ö¥¸¥§¥¯¥È¤ò²Ã¤¨¤ë / * Add the item "o_ptr" to a real stores inventory. - * - * If the item is "worthless", it is thrown away (except in the home). - * - * If the item cannot be combined with an object already in the inventory, - * make a new slot for it, and calculate its "per item" price. Note that - * this price will be negative, since the price will not be "fixed" yet. - * Adding an item to a "fixed" price stack will not change the fixed price. - * + * @param o_ptr ²Ã¤¨¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿ + * @return ¼ý¤á¤¿Àè¤ÎID + * @details + *
  * In all cases, return the slot (or -1) where the object was placed
+ * Note that this is a hacked up version of "inven_carry()".
+ * Also note that it may not correctly "adapt" to "knowledge" bacoming
+ * known, the player may have to pick stuff up and drop it again.
+ * 
*/ static int store_carry(object_type *o_ptr) { -- 2.11.0