The Equivelent PseudoCode


class Target
   public:
     OnComponentHit()
         ToggleLight()
         IncrementCount(hitCount)
         PrintStatus()

     OnActorOverlap
         ToggleLight
         IncrementCount(collisionCount)
         PrintStatus()

     ToggleLight()
         lighOn = not (lightOn)
         Light.SetVisibility(lightOn)

     IncrmentCount(int count)
         count++;
    
     DisplayStats()
         Print "I have been hit ", hitCount, " times"
         Print "I have been  run into ", collisionCount, " times"

   private:
     Light
     Cube
     Box
     bool lightOn = true
     int hitCount = 0
     int collisionCount = 0;

Class MultiColorTarget public Target
    public:
        OnActorOverlap
           Target::OnActorOverlap
           if (Target::LightOn) {
               Light.SetColor(colors[i])
               i++;
               if (colors.size() == i) {
                   i = 0;
               }
           }
    private:
        int i =0
        colors[] {red,pink, green}