Skip to content

Commit

Permalink
Removed some friend references from the object classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatyas committed Apr 9, 2024
1 parent 2c6e470 commit ec44e32
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 68 deletions.
2 changes: 0 additions & 2 deletions src/smw/objects/carriable/CO_Bomb.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ class CO_Bomb : public MO_CarriedObject {
short ttl;

Spotlight* sSpotlight;

friend class CPlayer;
};
5 changes: 2 additions & 3 deletions src/smw/objects/carriable/CO_Egg.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class CO_Egg : public MO_CarriedObject {

short egganimationrates[6];

friend class CPlayer;
friend class MO_Yoshi;
friend class CGM_Eggs;
friend class MO_Yoshi;
friend class CGM_Eggs;
};
4 changes: 1 addition & 3 deletions src/smw/objects/carriable/CO_Flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@ class CO_Flag : public MO_CarriedObject {
short owner_throw_timer;
bool centerflag;

friend class CPlayer;
friend class CGM_CTF;
friend class MO_FlagBase;
friend class MO_FlagBase;
};
2 changes: 1 addition & 1 deletion src/smw/objects/carriable/CO_PhantoKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ class CO_PhantoKey : public MO_CarriedObject {
short sparkleanimationtimer;
short sparkledrawframe;

friend class CGM_Chase;
friend class CGM_Chase;
};
23 changes: 5 additions & 18 deletions src/smw/objects/carriable/CO_Shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,9 @@ class CO_Shell : public MO_CarriedObject {

Spotlight* sSpotlight;

friend class CPlayer;
friend class MO_Explosion;
friend class MO_BulletBill;
friend class MO_Goomba;
friend class MO_Koopa;
friend class MO_BuzzyBeetle;
friend class MO_Spiny;
// friend class MO_SledgeBrother;
friend class MO_CheepCheep;
friend class MO_PirhanaPlant;

friend class MO_AttackZone;
friend class MO_SpinAttack;

friend class B_WeaponBreakableBlock;

friend void RunGame();
friend void shakeScreen();
friend class MO_AttackZone;
friend class MO_SpinAttack;

friend void RunGame();
friend void shakeScreen();
};
2 changes: 0 additions & 2 deletions src/smw/objects/carriable/CO_Spring.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@ class CO_Spring : public MO_CarriedObject {

bool fSuper;
short iOffsetY;

friend class CPlayer;
};
3 changes: 1 addition & 2 deletions src/smw/objects/carriable/CO_Star.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ class CO_Star : public MO_CarriedObject {
short sparkledrawframe;
short iID;

friend class CPlayer;
friend class CGM_Star;
friend class CGM_Star;
};
20 changes: 5 additions & 15 deletions src/smw/objects/carriable/CO_ThrowBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,10 @@ class CO_ThrowBlock : public MO_CarriedObject {

Spotlight* sSpotlight;

friend class CPlayer;
friend class MO_Explosion;
friend class MO_BulletBill;
friend class MO_Goomba;
// friend class MO_SledgeBrother;
friend class MO_CheepCheep;
friend class MO_SpinAttack;
friend class MO_AttackZone;
friend class MO_SpinAttack;
friend class MO_AttackZone;
friend class B_ThrowBlock;

friend class CO_Shell;

friend class B_ThrowBlock;
friend class B_WeaponBreakableBlock;

friend void RunGame();
friend void shakeScreen();
friend void RunGame();
friend void shakeScreen();
};
23 changes: 9 additions & 14 deletions src/smw/objects/carriable/CO_ThrowBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,13 @@ class CO_ThrowBox : public MO_CarriedObject {

Spotlight* sSpotlight;

friend class CPlayer;
friend class MO_Explosion;
friend class MO_BulletBill;
friend class MO_Goomba;
friend class MO_CheepCheep;
friend class MO_SpinAttack;
friend class MO_AttackZone;

friend class CO_ThrowBlock;
friend class CO_Shell;
friend class B_WeaponBreakableBlock;

friend void RunGame();
friend void shakeScreen();
friend class MO_Explosion;
friend class MO_BulletBill;
friend class MO_Goomba;
friend class MO_CheepCheep;
friend class MO_SpinAttack;
friend class MO_AttackZone;

friend void RunGame();
friend void shakeScreen();
};
2 changes: 1 addition & 1 deletion src/smw/objects/moving/MO_AttackZone.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ class MO_AttackZone : public IO_MovingObject {
short iTimer;
KillStyle iStyle;

friend class B_WeaponBreakableBlock;
friend class B_WeaponBreakableBlock;
};
3 changes: 1 addition & 2 deletions src/smw/objects/moving/MO_CarriedObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ class MO_CarriedObject : public IO_MovingObject {
private:
void init();

friend class B_ThrowBlock;
friend class CPlayer;
friend class CPlayer;
};
3 changes: 1 addition & 2 deletions src/smw/objects/moving/MO_FlagBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ class MO_FlagBase : public IO_MovingObject {

short timer;

friend class CO_Flag;
friend class CPlayer;
friend class CO_Flag;
};
3 changes: 0 additions & 3 deletions src/smw/objects/moving/MovingObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,11 @@ class IO_MovingObject : public CObject {

friend class MO_BulletBill;
friend class MO_WalkingEnemy;
friend class MO_Goomba;
friend class MO_CheepCheep;
friend class MO_PirhanaPlant;

friend class MovingPlatform;

friend void removeifprojectile(IO_MovingObject* object, bool playsound, bool forcedead);
friend void RunGame();
friend void shakeScreen();
friend void handleP2ObjCollisions();
};

0 comments on commit ec44e32

Please sign in to comment.