Thrive
rolling_grid.h
1 #pragma once
2 
3 #include "engine/typedefs.h"
4 #include <memory>
5 
6 // Defines a basic grid that fits the criteria set on issue 165
7 
8 namespace luabind {
9  class scope;
10 }
11 
12 namespace thrive {
13 
14 // TODO make generic
15 
16 class RollingGrid {
17 
18 public:
19 
28  int width, int height, int resolution
29  );
30 
34  ~RollingGrid();
35 
46  static luabind::scope
47  luaBindings();
48 
49  // TODO probably not the best move function
55  void
56  move(int dx, int dy);
57 
58  // TODO decide what happens on out-of-bounds accesses
65  int&
66  operator() (long x, long y);
67 
68  /*
69  * Lua-accessible position indexing
70  */
71  int
72  get(long x, long y);
73  void
74  set(long x, long y, int v);
75 
76 private:
77  struct Implementation;
78  std::unique_ptr<Implementation> m_impl;
79 };
80 
81 }
void move(int dx, int dy)
Definition: rolling_grid.cpp:183
RollingGrid(int width, int height, int resolution)
constructor
Definition: rolling_grid.cpp:174
int & operator()(long x, long y)
Definition: rolling_grid.cpp:188
Definition: rolling_grid.h:16
Definition: bullet_to_ogre_system.h:5
Definition: bullet_ogre_conversion.h:6
static luabind::scope luaBindings()
Lua bindings.
Definition: rolling_grid.cpp:164
~RollingGrid()
destructor
Definition: rolling_grid.cpp:180