MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / Load

Method Load

PanzerChasm/client/client.cpp:140–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140void Client::Load( const SaveLoadBuffer& buffer, unsigned int& buffer_pos )
141{
142 LoadStream load_stream( buffer, buffer_pos );
143
144 loaded_minimap_state_.reset( new LoadedMinimapState );
145
146 load_stream.ReadUInt32( requested_weapon_index_ );
147 load_stream.ReadBool( minimap_mode_ );
148 load_stream.ReadUInt32( loaded_minimap_state_->map_number );
149
150 unsigned int static_walls_count ;
151 load_stream.ReadUInt32( static_walls_count );
152 loaded_minimap_state_->static_walls_visibility .resize( static_walls_count );
153 for( unsigned int i= 0u; i < static_walls_count ; i++ )
154 {
155 bool b;
156 load_stream.ReadBool( b );
157 loaded_minimap_state_->static_walls_visibility [i]= b;
158 }
159
160 unsigned int dynamic_walls_count;
161 load_stream.ReadUInt32( dynamic_walls_count );
162 loaded_minimap_state_->dynamic_walls_visibility .resize( dynamic_walls_count );
163 for( unsigned int i= 0u; i < dynamic_walls_count; i++ )
164 {
165 bool b;
166 load_stream.ReadBool( b );
167 loaded_minimap_state_->dynamic_walls_visibility[i]= b;
168 }
169
170 buffer_pos= load_stream.GetBufferPos();
171}
172
173void Client::SetConnection( IConnectionPtr connection )
174{

Callers 1

DoLoadMethod · 0.45

Calls 3

ReadUInt32Method · 0.80
ReadBoolMethod · 0.80
GetBufferPosMethod · 0.80

Tested by

no test coverage detected