home · contact · privacy
Moved building/reading/writing of map objects into obejcts_on_map library. Fixed...
[plomrogue] / src / objects_on_map.h
index 4966161d90ec6b7cc239ff93973af56d2e6ac8e9..0d56c018e28c9b0ee24b13754a2cf2ac2d3de316 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef ACTORS_H
 #define ACTORS_H
 
+#include <stdio.h>
 #include "yx_uint16.h"
 
 struct World;
@@ -9,18 +10,29 @@ struct Map;
 struct Player {
   struct yx_uint16 pos; };
 
-struct Item {
-  struct Item * next;
+struct ChainMapObject {
+  void * next;
   unsigned char name;
   struct yx_uint16 pos; };
 
+struct Item {
+  struct ChainMapObject cmo; };
+
 struct Monster {
-  struct Monster * next;
-  unsigned char name;
-  struct yx_uint16 pos; };
+  struct ChainMapObject cmo;
+  unsigned char hitpoints; };
+
+extern void readwrite_map_objects_dummy (void *, FILE *);
+extern void write_map_objects_monsterdata (void *, FILE *);
+extern void write_map_objects (void * start, FILE *, void (*) (void *, FILE *) );
+extern void read_map_objects_monsterdata (void *, FILE *);
+extern void read_map_objects (void *, FILE *, size_t, void (*) (void *, FILE *) );
+extern void build_map_objects_monsterdata (void *);
+extern void build_map_objects_itemdata (void *);
+extern void build_map_objects (void *, unsigned char, size_t, void (*) (void *), struct Map *);
 
-extern char is_passable (struct Map *, struct yx_uint16);
 extern struct yx_uint16 find_passable_pos (struct Map *);
+extern char is_passable (struct Map *, struct yx_uint16);
 extern void move_monster (struct World *, struct Monster *);
 extern void move_player (struct World *, char);
 extern void player_wait(struct World *);