Creates an instance of contractData.
local data = contractData.new()
function contractor:getGamePublishingContract(gameObj, riskRating)
local publishData = self.data.publishing
local scale = gameObj:getScale()
local scale = scale - publishData.minimumGameScale
local deadline = timeline.curTime + self:calculateDeadline(1 - gameObj:getOverallCompletion(), scale) * timeline.DAYS_IN_MONTH
local rep = studio:getReputation()
local strength = math.lerp(publishData.minAdvertisement, 1, math.min(1, scale / (publishData.maxAdvertAtGameScale - publishData.minimumGameScale))) * math.lerp(publishData.minReputationAdvert, 1, (rep - publishData.minimumReputation) / (publishData.maximumReputation - publishData.minimumReputation))
local data = contractData.new()
data:setContractType(contractor.CONTRACT_TYPES.PUBLISHED)
data:setScale(gameObj:getScale())
data:setDeadline(deadline)
data:setAdvertisementStrength(math.lerp(publishData.popularityGainMin, publishData.popularityGainMax, strength))
data:setAdvertisementCosts(math.lerp(publishData.advertisementCostMin, publishData.advertisementCostMax, strength))
data:setFinalShares(math.lerp(publishData.minShare, publishData.maxShare, riskRating))
data:setMilestone(math.round(gameObj:getOverallCompletion(), 1))
return data
end