+void Universe::DumpEnv(int res, Vector<int> coords, float amount) {
+ if (coords.x < 0) coords.x = 0;
+ if (coords.x > bounds.x) coords.x = bounds.x - 1;
+ if (coords.y < 0) coords.y = 0;
+ if (coords.y > bounds.x) coords.y = bounds.y - 1;
+
+ int index = coords.x * bounds.y + coords.y;
+
+ Env &point = env[index];
+ Env::iterator entry(point.find(res));
+
+ if (entry == point.end()) {
+ point.emplace(res, amount);
+ } else {
+ entry->second += amount;
+ }
+}
+
+