summaryrefslogtreecommitdiff
path: root/BlockTree.h
diff options
context:
space:
mode:
authorJapa2011-02-19 17:02:15 +0000
committerJapa2011-02-19 17:02:15 +0000
commitd8523cd32f9aea85ce0ef0c6fb12c8562922dad2 (patch)
treef43d02a6f601c331e5a042dcdad1488822f61456 /BlockTree.h
parent5bebc22aca35d42ee3679a72b8470482390d4064 (diff)
parent4a8f5cb3b63e33436d56a94d22ea535620756251 (diff)
downloadstonesense-d8523cd32f9aea85ce0ef0c6fb12c8562922dad2.tar.gz
stonesense-d8523cd32f9aea85ce0ef0c6fb12c8562922dad2.tar.bz2
stonesense-d8523cd32f9aea85ce0ef0c6fb12c8562922dad2.tar.xz
merged in the multi-tile tree branch.
Diffstat (limited to 'BlockTree.h')
-rw-r--r--BlockTree.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/BlockTree.h b/BlockTree.h
new file mode 100644
index 0000000..2a8720d
--- /dev/null
+++ b/BlockTree.h
@@ -0,0 +1,65 @@
+#pragma once
+#include "common.h"
+#include "SpriteObjects.h"
+#include "Block.h"
+#include "WorldSegment.h"
+
+class c_block_tree_twig
+{
+ c_sprite own_sprite;
+ vector<c_sprite> westward_growth;
+ vector<c_sprite> eastward_growth;
+public:
+ c_block_tree_twig(void);
+ ~c_block_tree_twig(void);
+
+ void insert_sprites(WorldSegment * w, int x, int y, int z);
+ void set_single_sprite(void);
+ void set_sheetindex(int32_t in){ own_sprite.set_sheetindex(in); }
+ void set_fileindex(int32_t in){ own_sprite.set_fileindex(in); }
+ int32_t get_sheetindex(void){ return own_sprite.get_sheetindex(); }
+ void set_by_xml(TiXmlElement* elemSprite, int32_t fileindex);
+ void add_sprite(int x, c_sprite sprite);
+ void reset();
+
+ void draw_world(int x, int y, int z, bool chop = false){own_sprite.draw_world(x,y,z,chop);}
+};
+
+class c_block_tree_branch
+{
+ c_block_tree_twig own_twig;
+ vector<c_block_tree_twig> northward_growth;
+ vector<c_block_tree_twig> southward_growth;
+public:
+ c_block_tree_branch(void);
+ ~c_block_tree_branch(void);
+
+ void insert_sprites(WorldSegment * w, int x, int y, int z);
+ void set_sheetindex(int32_t in){ own_twig.set_sheetindex(in); }
+ void set_fileindex(int32_t in){ own_twig.set_fileindex(in); }
+ int32_t get_sheetindex(void){ return own_twig.get_sheetindex(); }
+ void set_by_xml(TiXmlElement* elemSprite, int32_t fileindex);
+ void add_sprite(int x, int y, c_sprite sprite);
+ void reset();
+
+ void draw_world(int x, int y, int z, bool chop = false){own_twig.draw_world(x,y,z,chop);}
+};
+
+class c_block_tree
+{
+ c_block_tree_branch own_branch;
+ vector<c_block_tree_branch> upward_growth;
+public:
+ c_block_tree(void);
+ ~c_block_tree(void);
+
+ void insert_sprites(WorldSegment * w, int x, int y, int z);
+ void set_sheetindex(int32_t in){ own_branch.set_sheetindex(in); }
+ void set_fileindex(int32_t in){ own_branch.set_fileindex(in); }
+ int32_t get_sheetindex(void){ return own_branch.get_sheetindex(); }
+ void set_by_xml(TiXmlElement* elemSprite, int32_t fileindex);
+ void add_sprite(int x, int y, int z, c_sprite sprite);
+ void reset();
+
+ void draw_world(int x, int y, int z, bool chop = false){own_branch.draw_world(x,y,z,chop);}
+};