Skip to content

Commit ffe53e5

Browse files
committed
refactor: adjust enclosing container function return type and name
1 parent 1abfd47 commit ffe53e5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Generals/Code/GameEngine/Include/GameLogic/Object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ class Object : public Thing, public Snapshot
421421
void onRemovedFrom( Object *removedFrom );
422422
Int getTransportSlotCount() const;
423423
void friend_setContainedBy( Object *containedBy ) { m_containedBy = containedBy; }
424-
ContainModuleInterface* getEnclosingContain(); // <<< Find the first enclosing container in the containment chain.
424+
Object* getEnclosingContainedBy(); // <<< Find the first enclosing container in the containment chain.
425425

426426
// Special Powers -------------------------------------------------------------------------------
427427
SpecialPowerModuleInterface *getSpecialPowerModule( const SpecialPowerTemplate *specialPowerTemplate ) const;

Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,13 +667,13 @@ Int Object::getTransportSlotCount() const
667667
return count;
668668
}
669669

670-
ContainModuleInterface* Object::getEnclosingContain()
670+
Object* Object::getEnclosingContainedBy()
671671
{
672672
for (Object* child = this, *container = getContainedBy(); container; child = container, container = container->getContainedBy())
673673
{
674674
ContainModuleInterface* containModule = container->getContain();
675675
if (containModule && containModule->isEnclosingContainerFor(child))
676-
return containModule;
676+
return container;
677677
}
678678

679679
return NULL;

GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ class Object : public Thing, public Snapshot
446446
void onRemovedFrom( Object *removedFrom );
447447
Int getTransportSlotCount() const;
448448
void friend_setContainedBy( Object *containedBy ) { m_containedBy = containedBy; }
449-
ContainModuleInterface* getEnclosingContain(); // <<< Find the first enclosing container in the containment chain.
449+
Object* getEnclosingContainedBy(); // <<< Find the first enclosing container in the containment chain.
450450

451451
// Special Powers -------------------------------------------------------------------------------
452452
SpecialPowerModuleInterface *getSpecialPowerModule( const SpecialPowerTemplate *specialPowerTemplate ) const;

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,13 +731,13 @@ Int Object::getTransportSlotCount() const
731731
return count;
732732
}
733733

734-
ContainModuleInterface* Object::getEnclosingContain()
734+
Object* Object::getEnclosingContainedBy()
735735
{
736736
for (Object* child = this, *container = getContainedBy(); container; child = container, container = container->getContainedBy())
737737
{
738738
ContainModuleInterface* containModule = container->getContain();
739739
if (containModule && containModule->isEnclosingContainerFor(child))
740-
return containModule;
740+
return container;
741741
}
742742

743743
return NULL;

0 commit comments

Comments
 (0)