The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Private Attributes | List of all members
synced_checkup Class Reference

This checkup compares whether the results calculated during the original game match the ones calculated during replay. More...

#include <synced_checkup.hpp>

Inheritance diagram for synced_checkup:

Public Member Functions

 synced_checkup (config &buffer)
 
virtual ~synced_checkup ()
 
virtual bool local_checkup (const config &expected_data, config &real_data)
 Compares data to the results calculated during the original game. More...
 
- Public Member Functions inherited from checkup
 checkup ()
 
virtual ~checkup ()
 

Private Attributes

configbuffer_
 
unsigned int pos_
 

Detailed Description

This checkup compares whether the results calculated during the original game match the ones calculated during replay.

Whether this checkup also compares the calculated results of different clients in a a mp game depends on whether there was already data sent about the current synced command.

Definition at line 43 of file synced_checkup.hpp.

Constructor & Destructor Documentation

◆ synced_checkup()

synced_checkup::synced_checkup ( config buffer)

Definition at line 54 of file synced_checkup.cpp.

◆ ~synced_checkup()

synced_checkup::~synced_checkup ( )
virtual

Definition at line 59 of file synced_checkup.cpp.

Member Function Documentation

◆ local_checkup()

bool synced_checkup::local_checkup ( const config expected_data,
config real_data 
)
virtual

Compares data to the results calculated during the original game.

It's undefined whether this function also compares calculated results from different clients in a mp game. returns whether the two config objects are equal.

Implements checkup.

Definition at line 63 of file synced_checkup.cpp.

References config::add_child(), buffer_, config::child_count(), config::empty(), config::mandatory_child(), and pos_.

Member Data Documentation

◆ buffer_

config& synced_checkup::buffer_
private

Definition at line 50 of file synced_checkup.hpp.

Referenced by local_checkup().

◆ pos_

unsigned int synced_checkup::pos_
private

Definition at line 51 of file synced_checkup.hpp.

Referenced by local_checkup().


The documentation for this class was generated from the following files: