]> git.treefish.org Git - seamulator.git/blobdiff - sea.cpp
Replaced sea and surface refs with shared pointers
[seamulator.git] / sea.cpp
diff --git a/sea.cpp b/sea.cpp
index 37a6cd67b04fe63e616f48d19d53be1d56f00018..42772d4d5534ba23e27bfbb2020c0c883ef766e9 100644 (file)
--- a/sea.cpp
+++ b/sea.cpp
@@ -2,15 +2,17 @@
 
 #include <cstdlib>
 
-Sea::Sea(WaterSurface& surface) : m_surface{surface}
+#include "watersurface.h"
+
+Sea::Sea(WaterSurfacePtr surface) : m_surface{surface}
 {
 }
 
 void Sea::update()
 {
-  for (int y = 0; y < m_surface.size(); ++y) {
-    for (int x = 0; x < m_surface.size(); ++x) {
-      m_surface.at(x, y)
+  for (int y = 0; y < m_surface->size(); ++y) {
+    for (int x = 0; x < m_surface->size(); ++x) {
+      m_surface->at(x, y)
        .setHeight(((double)std::rand()/(double)RAND_MAX));
     }
   }