summaryrefslogtreecommitdiff
path: root/src/map/searchstore.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/searchstore.h')
-rw-r--r--src/map/searchstore.h42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/map/searchstore.h b/src/map/searchstore.h
index ffa8e9784..61e65c7d2 100644
--- a/src/map/searchstore.h
+++ b/src/map/searchstore.h
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena Dev Teams
#ifndef _SEARCHSTORE_H_
#define _SEARCHSTORE_H_
@@ -7,8 +8,7 @@
#define SEARCHSTORE_RESULTS_PER_PAGE 10
/// information about the search being performed
-struct s_search_store_search
-{
+struct s_search_store_search {
struct map_session_data* search_sd; // sd of the searching player
const unsigned short* itemlist;
const unsigned short* cardlist;
@@ -18,9 +18,8 @@ struct s_search_store_search
unsigned int max_price;
};
-struct s_search_store_info_item
-{
- int store_id;
+struct s_search_store_info_item {
+ unsigned int store_id;
int account_id;
char store_name[MESSAGE_SIZE];
unsigned short nameid;
@@ -30,8 +29,7 @@ struct s_search_store_info_item
unsigned char refine;
};
-struct s_search_store_info
-{
+struct s_search_store_info {
unsigned int count;
struct s_search_store_info_item* items;
unsigned int pages; // amount of pages already sent to client
@@ -43,15 +41,21 @@ struct s_search_store_info
bool open;
};
-bool searchstore_open(struct map_session_data* sd, unsigned int uses, unsigned short effect);
-void searchstore_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);
-bool searchstore_querynext(struct map_session_data* sd);
-void searchstore_next(struct map_session_data* sd);
-void searchstore_clear(struct map_session_data* sd);
-void searchstore_close(struct map_session_data* sd);
-void searchstore_click(struct map_session_data* sd, int account_id, int store_id, unsigned short nameid);
-bool searchstore_queryremote(struct map_session_data* sd, int account_id);
-void searchstore_clearremote(struct map_session_data* sd);
-bool searchstore_result(struct map_session_data* sd, int store_id, int account_id, const char* store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short* card, unsigned char refine);
+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);
+ bool (*querynext) (struct map_session_data* sd);
+ void (*next) (struct map_session_data* sd);
+ void (*clear) (struct map_session_data* sd);
+ void (*close) (struct map_session_data* sd);
+ void (*click) (struct map_session_data* sd, int account_id, int store_id, unsigned short nameid);
+ bool (*queryremote) (struct map_session_data* sd, int account_id);
+ void (*clearremote) (struct map_session_data* sd);
+ bool (*result) (struct map_session_data* sd, unsigned int store_id, int account_id, const char* store_name, unsigned short nameid, unsigned short amount, unsigned int price, const short* card, unsigned char refine);
+} searchstore_s;
+
+struct searchstore_interface *searchstore;
+
+void searchstore_defaults (void);
#endif // _SEARCHSTORE_H_