He said, they said


I'm having a little bit of trouble understanding the following sentence
(namely the って言った and そういうことだった):

> 「メル、トレガーの養女になってお城に上がったんだってね。
>
> 僕のうちに来られない、って言ったのはそういうことだったんだ…」

I think the speaker might be quoting a third-party because it looks like "he
said" and then followed by "it was said". Is that about right...?

メル: a female character

トレガー: male character

The speaker is a 3rd character.

Edit: Funny to come back to this over 2 years later and be able to understand
it without it having to be explained to me! I guess practice really does bear
fruit :)




This そう言うこと is a set phrase that refers to some truth the speaker just
noticed; "how it is", "how it turned out", "the case" etc.

  * ああ、そういうことか！  
Ah, that's how it is!

  * そういうことなら、私にいい考えがあります。  
If that's the case, I have a good idea.

  * つまり彼は死んでいなかった、そういうこと？  
So, he was not dead, am I right?

So your sentence is:

> ［「僕のうちに来られない」って言ったの］は **そういうこと** だったんだ…  
>  So that's why she(/he?) said she could not come to my house...

(Without further context, the subject of 言った is probably メル because she is
clearly the subject of the sentence right before this. But if you are sure it
was トレガー who said "she cannot come" in the story, the subject of 言った can be
トレガー, too.)




This そう言うこと is a set phrase that refers to some truth the speaker just
noticed; "how it is", "how it turned out", "the case" etc.

  * ああ、そういうことか！  
Ah, that's how it is!

  * そういうことなら、私にいい考えがあります。  
If that's the case, I have a good idea.

  * つまり彼は死んでいなかった、そういうこと？  
So, he was not dead, am I right?

So your sentence is:

> ［「僕のうちに来られない」って言ったの］は **そういうこと** だったんだ…  
>  So that's why she(/he?) said she could not come to my house...

(Without further context, the subject of 言った is probably メル because she is
clearly the subject of the sentence right before this. But if you are sure it
was トレガー who said "she cannot come" in the story, the subject of 言った can be
トレガー, too.)

