1 #ifndef __GNUC__
2 #pragma once
3 #endif
4 #ifndef __XR_LEVEL_GRAPH_H__
5 #define __XR_LEVEL_GRAPH_H__
6 
7 #include <string>
8 #include <vector>
9 #include "xr_ai_graph.h"
10 
11 namespace xray_re {
12 
13 enum {
14 	GG_VERTEX2215_SIZE	= 0x28,
15 	GG_VERTEX_SIZE		= 0x2a,
16 
17 	GG_EDGE2215_SIZE	= 0x8,
18 	GG_EDGE_SIZE		= 0x6,
19 
20 	GG_LEVEL_POINT_SIZE	= 0x14,
21 };
22 
23 class xr_reader;
24 class xr_writer;
25 
26 class xr_level_graph {
27 public:
28 			xr_level_graph();
29 	virtual		~xr_level_graph();
30 
31 	void		load(xr_reader& r);
32 	void		save(xr_writer& w) const;
33 	bool		load(const char* path, const char* name);
34 	bool		save(const char* path, const char* name) const;
35 
36 	uint32_t&		version();
37 	uint32_t		version() const;
38 	uint32_t		num_levels() const;
39 	uint32_t		num_vertices() const;
40 	uint32_t		num_edges() const;
41 	uint32_t		num_death_points() const;
42 	xr_guid&		guid();
43 	const xr_guid&		guid() const;
44 	const gg_level*		levels() const;
45 	const gg_vertex*	vertices() const;
46 	const gg_edge*		edges() const;
47 	const gg_level_point*	death_points() const;
48 
49 protected:
50 	uint32_t		m_version;
51 	uint32_t		m_num_levels;
52 	uint32_t		m_num_vertices;
53 	uint32_t		m_num_edges;
54 	uint32_t		m_num_death_points;
55 	xr_guid			m_guid;
56 	gg_level*		m_levels;
57 	gg_vertex*		m_vertices;
58 	gg_edge*		m_edges;
59 	gg_level_point*		m_death_points;
60 };
61 
version()62 inline uint32_t& xr_level_graph::version() { return m_version; }
version()63 inline uint32_t xr_level_graph::version() const { return m_version; }
64 
num_levels()65 inline uint32_t xr_level_graph::num_levels() const { return m_num_levels; }
num_vertices()66 inline uint32_t xr_level_graph::num_vertices() const { return m_num_vertices; }
num_edges()67 inline uint32_t xr_level_graph::num_edges() const { return m_num_edges; }
num_death_points()68 inline uint32_t xr_level_graph::num_death_points() const { return m_num_death_points; }
69 
guid()70 inline xr_guid& xr_level_graph::guid() { return m_guid; }
guid()71 inline const xr_guid& xr_level_graph::guid() const { return m_guid; }
levels()72 inline const gg_level* xr_level_graph::levels() const { return m_levels; }
vertices()73 inline const gg_vertex* xr_level_graph::vertices() const { return m_vertices; }
edges()74 inline const gg_edge* xr_level_graph::edges() const { return m_edges; }
death_points()75 inline const gg_level_point* xr_level_graph::death_points() const { return m_death_points; }
76 
77 } // end of namespace xray_re
78 
79 #endif
80