From 7a5387cbd6aa4682c7f2845bde065a9e0b828e23 Mon Sep 17 00:00:00 2001 From: pauldubois Date: Sun, 23 Mar 2008 09:42:58 +0000 Subject: This was originally going to be a small refactor of stash.cc before getting into stash/item finding, but it ended up big. Removed the read/writeThing API in favor of the marshall/unmarshallThing API. It was slightly awkward in a couple spots where the format of writeThing and marshallThing differed slightly (strings, level_id, level_pos). Doesn't affect savegames. When it's is okay to break savegames (maybe just before releasing 0.4?) it would be nice to remove the few remaining redundancies listed above. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3828 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/stash.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/stash.h') diff --git a/crawl-ref/source/stash.h b/crawl-ref/source/stash.h index 6102f013fd..8ca50d0ca3 100644 --- a/crawl-ref/source/stash.h +++ b/crawl-ref/source/stash.h @@ -21,6 +21,8 @@ #include "travel.h" class input_history; +class reader; +class writer; // Stash definitions void stash_init_new_level(); @@ -46,8 +48,8 @@ public: static std::string stash_item_name(const item_def &item); void update(); - void save(FILE*) const; - void load(FILE*); + void save(writer&) const; + void load(reader&); std::string description() const; std::string feature_description() const; @@ -121,9 +123,8 @@ public: std::string description() const; - // Note that we aren't bothering to use virtual functions here. - void save(FILE*) const; - void load(FILE*); + void save(writer&) const; + void load(reader&); bool show_menu(const std::string &place, bool can_travel) const; bool is_visited() const { return items.size() || visited; } @@ -232,8 +233,8 @@ public: void kill_stash(const Stash &s); - void save(FILE *) const; - void load(FILE *); + void save(writer&) const; + void load(reader&); void write(std::ostream &os, bool identify = false) const; std::string level_name() const; @@ -308,8 +309,8 @@ public: // used if no parameters are supplied. void no_stash(int x = -1, int y = -1); - void save(FILE*) const; - void load(FILE*); + void save(writer&) const; + void load(reader&); void write(std::ostream &os, bool identify = false) const; -- cgit v1.2.3-54-g00ecf