#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));
}
}