Bethesda hired Behavior Interactive under a work-for-hire contract to create the Fallout Shelter game. The terms of the contract stated that all work done by Behavior for Fallout Shelter became property of Bethesda, which included code, designs, artwork, etc.
Warner Bros hired Behavior to create the Westworld game. Behavior then allegedly used the same code that was used for the Fallout Shelter game. While the code in both games was potentially the sole work of Behavor, legally, what was used for Fallout Shelter legally belongs to Bethesda.