diff options
Diffstat (limited to 'src/T2DLL/T2EquipDef.cpp')
-rw-r--r-- | src/T2DLL/T2EquipDef.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/T2DLL/T2EquipDef.cpp b/src/T2DLL/T2EquipDef.cpp index bb694d6..6084b5c 100644 --- a/src/T2DLL/T2EquipDef.cpp +++ b/src/T2DLL/T2EquipDef.cpp @@ -8,7 +8,9 @@ #include "T2InfoDialog.h" #include "T2People.h" #include "T2PeopleLinkIterator.h" +#include "T2Tenant.h" #include "T2TowerDoc.h" +#include "T2WordDefArray.h" #include "T2WorldDef.h" #include "UT2Coordinate.h" @@ -82,7 +84,7 @@ T2EquipDef::T2EquipDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFi delete mWordDefArray; } -/*virtual*/ int T2EquipDef::InitObject(T2Object* object) { +/*virtual*/ BOOL T2EquipDef::InitObject(T2Object* object) { object->SetUsed(true); ((T2Equip *) object)->mEquipType = GetEquipType(); ((T2Equip *) object)->mCapacity = mCapacity; @@ -148,13 +150,14 @@ T2EquipDef::T2EquipDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFi return new T2InfoDialog(equip); } -/*virtual*/ void T2EquipDef::DrawPeople(T2TowerDoc* towerDoc, T2Equip* equip) { - //T2People *people = (T2People *) equip; - //T2PeopleLinkIterator iter(people); - //T2People *i; - //while (iter.Next(&i)) - // i->Draw(towerDoc, people); - // TODO: which subclass is this...? +/*virtual*/ void T2EquipDef::DrawPeople(T2TowerDoc* inDoc, T2Equip* inEquip) { + T2Tenant *theTenant = (T2Tenant *) inEquip; + + T2PeopleLinkIterator iterator(theTenant->mFirstPeople); + T2People *thePeople; + + while (iterator.Next(&thePeople)) + thePeople->Draw(inDoc, inEquip); } int T2EquipDef::GetInMoney(int i) { @@ -164,23 +167,23 @@ int T2EquipDef::GetInMoney(int i) { return cost; } -/*virtual*/ void T2EquipDef::LoadExtraData(T2Archive& archive, T2TowerDoc*, T2HaveOutViewObject*) { - int len; - archive >> len; +/*virtual*/ void T2EquipDef::LoadExtraData(T2Archive& inArchive, T2TowerDoc*, T2HaveOutViewObject*) { + int size; + inArchive >> size; - for (int i = 0; i < len; i++) { + for (int i = 0; i < size; i++) { unsigned char b; - archive >> b; + inArchive >> b; } } -/*virtual*/ void T2EquipDef::SaveExtraData(T2Archive& archive, T2HaveOutViewObject*) { - int len = 0; - archive << len; +/*virtual*/ void T2EquipDef::SaveExtraData(T2Archive& inArchive, T2HaveOutViewObject*) { + int size = 0; + inArchive << size; } T2WordDefArray* T2EquipDef::MakeWordDefArray() { - return 0; // TODO + return new T2WordDefArray(mModuleHandle); } void T2EquipDef::GetWords(T2People*, CString&) const { |