OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
fplock.cpp
Go to the documentation of this file.
1#include "fplock.h"
2#include "waypoint.h"
3
4#include "game/serialize.h"
5
8
10 :pt(&p){
11 pt->useCount++;
12 }
13
15 :pt(p){
16 if(pt)
17 pt->useCount++;
18 }
19
21 :pt(other.pt){
22 other.pt=nullptr;
23 }
24
26 if(pt)
27 pt->useCount--;
28 }
29
31 if(pt)
32 pt->useCount--;
33 pt = other.pt;
34 other.pt=nullptr;
35 return *this;
36 }
37
39 fin.read(pt);
40 if(pt)
41 pt->useCount++;
42 }
43
44void FpLock::save(Serialize &fout) const {
45 fout.write(pt);
46 }
Definition fplock.h:6
void save(Serialize &fout) const
Definition fplock.cpp:44
FpLock & operator=(FpLock &&other)
Definition fplock.cpp:30
FpLock()
Definition fplock.cpp:6
~FpLock()
Definition fplock.cpp:25
void load(Serialize &fin)
Definition fplock.cpp:38
void write(const Arg &... a)
Definition serialize.h:76
void read(Arg &... a)
Definition serialize.h:81