3 * Iter Vehemens ad Necem (IVAN)
4 * Copyright (C) Timo Kiviluoto
5 * Released under the GNU General
8 * See LICENSING which should be included
9 * along with this file for more details
15 #include "ivancommon.h"
18 template <class base
, class lockbase
>
19 class lockable
: public base
, public lockbase
22 typedef typename
lockbase::prototype prototype
;
24 virtual ~lockable () {}
26 virtual void Save(outputfile
&) const;
27 virtual void Load(inputfile
&);
28 virtual truth
IsOpenable(ccharacter
*) const { return true; }
29 virtual truth
HasLock(ccharacter
*) const { return true; }
30 virtual truth
IsLocked() const { return lockbase::Locked
; }
31 virtual void SetIsLocked(truth What
) { lockbase::Locked
= What
; }
32 virtual void Lock() { lockbase::Locked
= true; }
33 virtual int GetVirtualConfig() const { return base::GetConfig(); }
34 virtual void SetVirtualConfig(int What
, int F
= 0) { base::SetConfig(What
, F
); }
35 virtual const prototype
* GetVirtualProtoType() const { return base::GetProtoType(); }
36 virtual festring
GetVirtualDescription(int Case
) const { return base::GetDescription(Case
); }
37 virtual truth
TryKey(item
* K
, character
* C
) { return lockbase::TryKey(K
, C
); }
39 virtual void PostConstruct();
42 template <class base
, class lockbase
>
43 inline void lockable
<base
, lockbase
>::Save(outputfile
& SaveFile
) const
46 lockbase::Save(SaveFile
);
49 template <class base
, class lockbase
>
50 inline void lockable
<base
, lockbase
>::Load(inputfile
& SaveFile
)
53 lockbase::Load(SaveFile
);
56 template <class base
, class lockbase
>
57 inline void lockable
<base
, lockbase
>::PostConstruct()
59 lockbase::PostConstruct();
60 base::PostConstruct();