2
2
#include < Ext/Bullet/Body.h>
3
3
#include < Ext/WeaponType/Body.h>
4
4
5
- bool StraightTrajectoryType::Load (PhobosStreamReader& Stm, bool RegisterForChange)
6
- {
7
- this ->PhobosTrajectoryType ::Load (Stm, false );
8
-
9
- Stm
10
- .Process (this ->DetonationDistance , false )
11
- .Process (this ->ApplyRangeModifiers , false )
12
- .Process (this ->TargetSnapDistance , false )
13
- .Process (this ->PassThrough , false )
14
- ;
15
-
16
- return true ;
17
- }
18
-
19
5
PhobosTrajectory* StraightTrajectoryType::CreateInstance () const
20
6
{
21
7
return new StraightTrajectory (this );
22
8
}
23
9
24
- bool StraightTrajectoryType::Save (PhobosStreamWriter& Stm) const
10
+ template <typename T>
11
+ void StraightTrajectoryType::Serialize (T& Stm)
25
12
{
26
- this ->PhobosTrajectoryType ::Save (Stm);
27
-
28
13
Stm
29
14
.Process (this ->DetonationDistance )
30
15
.Process (this ->ApplyRangeModifiers )
31
16
.Process (this ->TargetSnapDistance )
32
17
.Process (this ->PassThrough )
33
18
;
19
+ }
34
20
21
+ bool StraightTrajectoryType::Load (PhobosStreamReader& Stm, bool RegisterForChange)
22
+ {
23
+ this ->PhobosTrajectoryType ::Load (Stm, false );
24
+ this ->Serialize (Stm);
35
25
return true ;
36
26
}
37
27
28
+ bool StraightTrajectoryType::Save (PhobosStreamWriter& Stm) const
29
+ {
30
+ this ->PhobosTrajectoryType ::Save (Stm);
31
+ const_cast <StraightTrajectoryType*>(this )->Serialize (Stm);
32
+ return true ;
33
+ }
38
34
39
35
void StraightTrajectoryType::Read (CCINIClass* const pINI, const char * pSection)
40
36
{
@@ -46,17 +42,22 @@ void StraightTrajectoryType::Read(CCINIClass* const pINI, const char* pSection)
46
42
this ->PassThrough .Read (exINI, pSection, " Trajectory.Straight.PassThrough" );
47
43
}
48
44
49
- bool StraightTrajectory::Load (PhobosStreamReader& Stm, bool RegisterForChange)
45
+ template <typename T>
46
+ void StraightTrajectory::Serialize (T& Stm)
50
47
{
51
- this ->PhobosTrajectory ::Load (Stm, false );
52
-
53
48
Stm
54
49
.Process (this ->DetonationDistance )
55
50
.Process (this ->TargetSnapDistance )
56
51
.Process (this ->PassThrough )
57
52
.Process (this ->FirerZPosition )
58
53
.Process (this ->TargetZPosition )
59
54
;
55
+ }
56
+
57
+ bool StraightTrajectory::Load (PhobosStreamReader& Stm, bool RegisterForChange)
58
+ {
59
+ this ->PhobosTrajectory ::Load (Stm, false );
60
+ this ->Serialize (Stm);
60
61
61
62
return true ;
62
63
}
@@ -65,13 +66,7 @@ bool StraightTrajectory::Save(PhobosStreamWriter& Stm) const
65
66
{
66
67
this ->PhobosTrajectory ::Save (Stm);
67
68
68
- Stm
69
- .Process (this ->DetonationDistance )
70
- .Process (this ->TargetSnapDistance )
71
- .Process (this ->PassThrough )
72
- .Process (this ->FirerZPosition )
73
- .Process (this ->TargetZPosition )
74
- ;
69
+ const_cast <StraightTrajectory*>(this )->Serialize (Stm);
75
70
76
71
return true ;
77
72
}
0 commit comments