mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 06:29:18 +02:00
reformat: functions can be made static
This commit is contained in:
@@ -25,17 +25,17 @@ class state_manager {
|
||||
|
||||
public:
|
||||
// methods
|
||||
void
|
||||
static void
|
||||
init_scripting_interface();
|
||||
// legacy method, calculates changes in simulation state over specified time
|
||||
void
|
||||
static void
|
||||
update( double Deltatime, int Iterationcount );
|
||||
void
|
||||
static void
|
||||
update_clocks();
|
||||
void
|
||||
update_scripting_interface();
|
||||
// process input commands
|
||||
void
|
||||
static void
|
||||
process_commands();
|
||||
// create model from node string
|
||||
TAnimModel *
|
||||
@@ -44,10 +44,10 @@ public:
|
||||
TEventLauncher *
|
||||
create_eventlauncher(const std::string &src, const std::string &name, const glm::dvec3 &position);
|
||||
// delete TAnimModel instance
|
||||
void
|
||||
static void
|
||||
delete_model(TAnimModel *model);
|
||||
// delete TEventLauncher instance
|
||||
void
|
||||
static void
|
||||
delete_eventlauncher(TEventLauncher *launcher);
|
||||
// starts deserialization from specified file, returns context pointer on success, throws otherwise
|
||||
std::shared_ptr<deserializer_state>
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
// calculates current season of the year based on set simulation date
|
||||
void compute_season( int Yearday );
|
||||
// calculates current weather
|
||||
void compute_weather();
|
||||
static void compute_weather();
|
||||
// data access
|
||||
auto const &
|
||||
sun() const {
|
||||
|
||||
@@ -1281,7 +1281,8 @@ state_serializer::export_as_text(std::string const &Scenariofile) const {
|
||||
}
|
||||
|
||||
void
|
||||
state_serializer::export_nodes_to_stream(std::ostream &scmfile, bool Dirty) const {
|
||||
state_serializer::export_nodes_to_stream(std::ostream &scmfile, bool Dirty)
|
||||
{
|
||||
// groups
|
||||
scmfile << "// groups\n";
|
||||
scene::Groups.export_as_text( scmfile, Dirty );
|
||||
|
||||
@@ -49,33 +49,33 @@ public:
|
||||
private:
|
||||
// methods
|
||||
// restores class data from provided stream
|
||||
void deserialize_area( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_isolated( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_assignment( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_atmo( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_camera( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_config( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_area( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_isolated( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_assignment( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_atmo( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_camera( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_config( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_description( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_event( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_lua( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_lua( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_firstinit( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_group( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_endgroup( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_group( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_endgroup( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_light( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_node( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_origin( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_endorigin( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_scale( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_endscale( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_rotate( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_origin( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_endorigin( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_scale( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_endscale( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static void deserialize_rotate( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_sky( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_test( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_time( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_trainset( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_terrain( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_editorterrain( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
void deserialize_endtrainset( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
TTrack * deserialize_path( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||
static void deserialize_endtrainset( cParser &Input, scene::scratch_data &Scratchpad );
|
||||
static TTrack * deserialize_path( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||
TTraction * deserialize_traction( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||
TTractionPowerSource * deserialize_tractionpowersource( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||
TMemCell * deserialize_memorycell( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||
@@ -83,12 +83,12 @@ private:
|
||||
TAnimModel * deserialize_model( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||
TDynamicObject * deserialize_dynamic( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||
sound_source * deserialize_sound( cParser &Input, scene::scratch_data &Scratchpad, scene::node_data const &Nodedata );
|
||||
void init_time();
|
||||
static void init_time();
|
||||
// skips content of stream until specified token
|
||||
void skip_until( cParser &Input, std::string const &Token );
|
||||
static void skip_until( cParser &Input, std::string const &Token );
|
||||
// transforms provided location by specifed rotation and offset
|
||||
glm::dvec3 transform( glm::dvec3 Location, scene::scratch_data const &Scratchpad );
|
||||
void export_nodes_to_stream( std::ostream &, bool Dirty ) const;
|
||||
static glm::dvec3 transform( glm::dvec3 Location, scene::scratch_data const &Scratchpad );
|
||||
static void export_nodes_to_stream( std::ostream &, bool Dirty );
|
||||
};
|
||||
|
||||
} // simulation
|
||||
|
||||
@@ -194,7 +194,8 @@ void scenario_time::set_time(int yearday, int minute) {
|
||||
|
||||
// calculates day of week for provided date
|
||||
int
|
||||
scenario_time::day_of_week( int const Day, int const Month, int const Year ) const {
|
||||
scenario_time::day_of_week( int const Day, int const Month, int const Year )
|
||||
{
|
||||
|
||||
// using Zeller's congruence, http://en.wikipedia.org/wiki/Zeller%27s_congruence
|
||||
int const q = Day;
|
||||
@@ -234,7 +235,8 @@ scenario_time::day_of_month( int const Week, int const Weekday, int const Month,
|
||||
|
||||
// returns number of days between specified days of week
|
||||
int
|
||||
scenario_time::weekdays( int const First, int const Second ) const {
|
||||
scenario_time::weekdays( int const First, int const Second )
|
||||
{
|
||||
|
||||
if( Second >= First ) { return Second - First; }
|
||||
else { return 7 - First + Second; }
|
||||
@@ -249,7 +251,8 @@ scenario_time::convert_transition_time( SYSTEMTIME &Time ) const {
|
||||
}
|
||||
|
||||
bool
|
||||
scenario_time::is_leap( int const Year ) const {
|
||||
scenario_time::is_leap( int const Year )
|
||||
{
|
||||
|
||||
return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0);
|
||||
|
||||
|
||||
@@ -56,17 +56,17 @@ private:
|
||||
int
|
||||
year_day( int Day, int Month, int Year ) const;
|
||||
// calculates day of week for provided date
|
||||
int
|
||||
day_of_week( int Day, int Month, int Year ) const;
|
||||
static int
|
||||
day_of_week( int Day, int Month, int Year );
|
||||
// calculates day of month for specified weekday of specified month of the year
|
||||
int
|
||||
day_of_month( int Week, int Weekday, int Month, int Year ) const;
|
||||
// returns number of days between specified days of week
|
||||
int
|
||||
weekdays( int First, int Second ) const;
|
||||
static int
|
||||
weekdays( int First, int Second );
|
||||
// returns true if specified year is a leap year, false otherwise
|
||||
bool
|
||||
is_leap( int Year ) const;
|
||||
static bool
|
||||
is_leap( int Year );
|
||||
|
||||
SYSTEMTIME m_time;
|
||||
double m_milliseconds{ 0.0 };
|
||||
|
||||
Reference in New Issue
Block a user