]> git.treefish.org Git - seamulator.git/blob - sea.cpp
42772d4d5534ba23e27bfbb2020c0c883ef766e9
[seamulator.git] / sea.cpp
1 #include "sea.h"
2
3 #include <cstdlib>
4
5 #include "watersurface.h"
6
7 Sea::Sea(WaterSurfacePtr surface) : m_surface{surface}
8 {
9 }
10
11 void Sea::update()
12 {
13   for (int y = 0; y < m_surface->size(); ++y) {
14     for (int x = 0; x < m_surface->size(); ++x) {
15       m_surface->at(x, y)
16         .setHeight(((double)std::rand()/(double)RAND_MAX));
17     }
18   }
19 }