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/travel.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'crawl-ref/source/travel.h') diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index c0ce805db7..f9f4b616d1 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -10,13 +10,16 @@ * <1> -/--/-- SD Created */ #ifndef TRAVEL_H -# define TRAVEL_H +#define TRAVEL_H -# include "externs.h" -# include -# include -# include -# include +#include "externs.h" +#include +#include +#include +#include + +class reader; +class writer; enum run_check_type { @@ -257,8 +260,8 @@ public: return (branch < id.branch) || (branch==id.branch && depth < id.depth); } - void save(FILE *) const; - void load(FILE *); + void save(writer&) const; + void load(reader&); }; // A position on a particular level. @@ -309,8 +312,8 @@ struct level_pos pos = coord_def(-1, -1); } - void save(FILE *) const; - void load(FILE *); + void save(writer&) const; + void load(reader&); }; struct travel_target @@ -409,8 +412,8 @@ public: void clear_distance() { distance = -1; } - void save(FILE *) const; - void load(FILE *); + void save(writer&) const; + void load(reader&); std::string describe() const; @@ -440,8 +443,8 @@ struct LevelInfo { } - void save(FILE *) const; - void load(FILE *); + void save(writer&) const; + void load(reader&); std::vector &get_stairs() { @@ -548,8 +551,8 @@ public: void update(); - void save(FILE *) const; - void load(FILE *); + void save(writer&) const; + void load(reader&); bool is_known_branch(unsigned char branch) const; -- cgit v1.2.3-54-g00ecf