static */
| 44 | } |
| 45 | |
| 46 | /* static */ StoryPageID ScriptStoryPage::New(ScriptCompany::CompanyID company, Text *title) |
| 47 | { |
| 48 | ScriptObjectRef counter(title); |
| 49 | |
| 50 | EnforceDeityMode(STORY_PAGE_INVALID); |
| 51 | EnforcePrecondition(STORY_PAGE_INVALID, company == ScriptCompany::COMPANY_INVALID || ScriptCompany::ResolveCompanyID(company) != ScriptCompany::COMPANY_INVALID); |
| 52 | |
| 53 | ::CompanyID c = ScriptCompany::FromScriptCompanyID(company); |
| 54 | |
| 55 | if (!ScriptObject::Command<CMD_CREATE_STORY_PAGE>::Do(&ScriptInstance::DoCommandReturnStoryPageID, |
| 56 | c, title != nullptr ? title->GetEncodedText() : EncodedString{})) return STORY_PAGE_INVALID; |
| 57 | |
| 58 | /* In case of test-mode, we return StoryPageID 0 */ |
| 59 | return StoryPageID::Begin(); |
| 60 | } |
| 61 | |
| 62 | /* static */ StoryPageElementID ScriptStoryPage::NewElement(StoryPageID story_page_id, StoryPageElementType type, SQInteger reference, Text *text) |
| 63 | { |
nothing calls this directly
no test coverage detected