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
16 #include "ivancommon.h"
35 virtual void Empty() = 0;
36 virtual void Save(outputfile
&) const;
37 virtual void Load(inputfile
&);
38 item
* GetItem() const { return Item
; }
39 item
* operator->() const { return Item
; }
40 item
* operator*() const { return Item
; }
41 virtual void AddFriendItem(item
*) const = 0;
42 virtual truth
IsOnGround() const { return false; }
43 virtual void PutInItem(item
*) = 0;
44 virtual square
* GetSquareUnder(int = 0) const = 0;
45 virtual void SignalVolumeAndWeightChange() = 0;
46 virtual void SignalEmitationIncrease(col24
) = 0;
47 virtual void SignalEmitationDecrease(col24
) = 0;
48 virtual void DonateTo(item
*);
49 virtual truth
CanBeSeenBy(ccharacter
*) const = 0;
50 virtual void SignalEnchantmentChange() { }
51 virtual truth
IsVisible() const = 0;
52 virtual truth
IsGearSlot() const { return false; }
53 virtual ccharacter
* FindCarrier() const = 0;
58 class stackslot
: public slot
62 friend class stackiterator
;
64 stackslot(stack
* MotherStack
, stackslot
* Last
) : MotherStack(MotherStack
), Last(Last
), Next(0) { }
65 virtual ~stackslot () {}
68 virtual void AddFriendItem(item
*) const;
69 virtual truth
IsOnGround() const;
70 virtual square
* GetSquareUnder(int = 0) const;
71 virtual void SignalVolumeAndWeightChange();
72 virtual void SignalEmitationIncrease(col24
);
73 virtual void SignalEmitationDecrease(col24
);
74 virtual void DonateTo(item
*);
75 virtual truth
CanBeSeenBy(ccharacter
*) const;
76 stack
* GetMotherStack() const { return MotherStack
; }
77 void SetMotherStack(stack
* What
) { MotherStack
= What
; }
78 virtual truth
IsVisible() const;
79 virtual void PutInItem(item
*);
80 virtual void Load(inputfile
&);
81 virtual ccharacter
* FindCarrier() const;
88 class bodypartslot
: public slot
91 virtual ~bodypartslot () {}
94 character
* GetMaster() const { return Master
; }
95 void SetMaster(character
* What
) { Master
= What
; }
96 virtual void AddFriendItem(item
*) const;
97 virtual square
* GetSquareUnder(int = 0) const;
98 virtual void SignalVolumeAndWeightChange();
99 virtual void SignalEmitationIncrease(col24
);
100 virtual void SignalEmitationDecrease(col24
);
101 virtual void PutInItem(item
*);
102 virtual void Load(inputfile
&);
103 virtual truth
CanBeSeenBy(ccharacter
*) const;
104 virtual truth
IsVisible() const { return false; }
105 virtual ccharacter
* FindCarrier() const { return Master
; }
110 class gearslot
: public slot
113 virtual ~gearslot () {}
115 virtual void Empty();
116 bodypart
* GetBodyPart() const { return BodyPart
; }
117 void SetBodyPart(bodypart
* What
) { BodyPart
= What
; }
118 virtual void AddFriendItem(item
*) const;
119 void Init(bodypart
*, int);
120 int GetEquipmentIndex() const { return EquipmentIndex
; }
121 void SetEquipmentIndex(int What
) { EquipmentIndex
= What
; }
122 virtual void PutInItem(item
*);
123 virtual square
* GetSquareUnder(int = 0) const;
124 virtual void SignalVolumeAndWeightChange();
125 virtual void SignalEmitationIncrease(col24
);
126 virtual void SignalEmitationDecrease(col24
);
127 virtual truth
CanBeSeenBy(ccharacter
*) const;
128 virtual void SignalEnchantmentChange();
129 virtual truth
IsVisible() const { return false; }
130 virtual truth
IsGearSlot() const { return true; }
131 virtual ccharacter
* FindCarrier() const;
137 inline outputfile
& operator<<(outputfile
& SaveFile
, const slot
& Slot
)
143 inline inputfile
& operator>>(inputfile
& SaveFile
, slot
& Slot
)