diff options
author | shennetsind <ind@henn.et> | 2013-09-28 15:11:03 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-09-28 15:11:03 -0300 |
commit | 871f83f62bf4eb1043bbda182fe0346454686a16 (patch) | |
tree | 3683cff1d1fbeb91934f4994b22798739c0cf6c3 | |
parent | 59f5e93505e888db5a3f2a44098c5fd4eaf7847d (diff) | |
download | hercules-871f83f62bf4eb1043bbda182fe0346454686a16.tar.gz hercules-871f83f62bf4eb1043bbda182fe0346454686a16.tar.bz2 hercules-871f83f62bf4eb1043bbda182fe0346454686a16.tar.xz hercules-871f83f62bf4eb1043bbda182fe0346454686a16.zip |
HPM: Searchstore.c Completed
Moved missing declarations of interest.
Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r-- | src/map/searchstore.c | 28 | ||||
-rw-r--r-- | src/map/searchstore.h | 35 |
2 files changed, 35 insertions, 28 deletions
diff --git a/src/map/searchstore.c b/src/map/searchstore.c index 6fd6f6aad..0144aea93 100644 --- a/src/map/searchstore.c +++ b/src/map/searchstore.c @@ -11,34 +11,6 @@ #include "pc.h" // struct map_session_data #include "searchstore.h" // struct s_search_store_info - -/// failure constants for clif functions -enum e_searchstore_failure { - SSI_FAILED_NOTHING_SEARCH_ITEM = 0, // "No matching stores were found." - SSI_FAILED_OVER_MAXCOUNT = 1, // "There are too many results. Please enter more detailed search term." - SSI_FAILED_SEARCH_CNT = 2, // "You cannot search anymore." - SSI_FAILED_LIMIT_SEARCH_TIME = 3, // "You cannot search yet." - SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE = 4, // "No sale (purchase) information available." -}; - - -enum e_searchstore_searchtype { - SEARCHTYPE_VENDING = 0, - SEARCHTYPE_BUYING_STORE = 1, -}; - - -enum e_searchstore_effecttype { - EFFECTTYPE_NORMAL = 0, - EFFECTTYPE_CASH = 1, - EFFECTTYPE_MAX -}; - - -/// type for shop search function -typedef bool (*searchstore_search_t)(struct map_session_data* sd, unsigned short nameid); -typedef bool (*searchstore_searchall_t)(struct map_session_data* sd, const struct s_search_store_search* s); - struct searchstore_interface searchstore_s; /// retrieves search function by type diff --git a/src/map/searchstore.h b/src/map/searchstore.h index 42d47c7c0..d7a327181 100644 --- a/src/map/searchstore.h +++ b/src/map/searchstore.h @@ -5,8 +5,36 @@ #ifndef _SEARCHSTORE_H_ #define _SEARCHSTORE_H_ +/** + * Defines + **/ #define SEARCHSTORE_RESULTS_PER_PAGE 10 +/** + * Enumerations + **/ +enum e_searchstore_searchtype { + SEARCHTYPE_VENDING = 0, + SEARCHTYPE_BUYING_STORE = 1, +}; + +enum e_searchstore_effecttype { + EFFECTTYPE_NORMAL = 0, + EFFECTTYPE_CASH = 1, + EFFECTTYPE_MAX +}; +/// failure constants for clif functions +enum e_searchstore_failure { + SSI_FAILED_NOTHING_SEARCH_ITEM = 0, // "No matching stores were found." + SSI_FAILED_OVER_MAXCOUNT = 1, // "There are too many results. Please enter more detailed search term." + SSI_FAILED_SEARCH_CNT = 2, // "You cannot search anymore." + SSI_FAILED_LIMIT_SEARCH_TIME = 3, // "You cannot search yet." + SSI_FAILED_SSILIST_CLICK_TO_OPEN_STORE = 4, // "No sale (purchase) information available." +}; + +/** + * Structures + **/ /// information about the search being performed struct s_search_store_search { struct map_session_data* search_sd; // sd of the searching player @@ -41,6 +69,13 @@ struct s_search_store_info { bool open; }; +/// type for shop search function +typedef bool (*searchstore_search_t)(struct map_session_data* sd, unsigned short nameid); +typedef bool (*searchstore_searchall_t)(struct map_session_data* sd, const struct s_search_store_search* s); + +/** + * Interface + **/ struct searchstore_interface { bool (*open) (struct map_session_data* sd, unsigned int uses, unsigned short effect); void (*query) (struct map_session_data* sd, unsigned char type, unsigned int min_price, unsigned int max_price, const unsigned short* itemlist, unsigned int item_count, const unsigned short* cardlist, unsigned int card_count); |