Sectors.cpp
Go to the documentation of this file.
1 #include "Sectors.hpp"
2 
3 namespace comp
4 {
5 
7  cm( inst, this, "Blocks::Listener" ),
8  inst( inst ),
9  sectors( sectors )
10 {
11  this->sectors->AddListener( this );
12 }
13 
15 {
16  this->sectors->RemoveListener( this );
17 }
18 
20 {
21  return this->inst;
22 }
23 
24 void Sectors::Load( iv::ClientMarker * modifier, iv::int2 block )
25 {
26  for( Listener * listener : this->listeners )
27  listener->Sector_Load( block );
28 }
29 
30 void Sectors::Unload( iv::ClientMarker * modifier, iv::int2 block )
31 {
32  for( Listener * listener : this->listeners )
33  listener->Sector_Unload( block );
34 }
35 
36 void Sectors::AddListener( Listener * listener )
37 {
38  this->listeners.insert( listener );
39 }
40 
42 {
43  this->listeners.erase( listener );
44 }
45 
46 }