Public Types | Static Public Member Functions

ScriptNews Class Reference

Class that handles news messages. More...

#include <script_news.hpp>

Inheritance diagram for ScriptNews:
ScriptObject SimpleCountedObject

Public Types

enum  NewsType {
  NT_ARRIVAL_COMPANY = ::NS_ARRIVAL_COMPANY, NT_ARRIVAL_OTHER = ::NS_ARRIVAL_OTHER, NT_ACCIDENT = ::NS_ACCIDENT, NT_COMPANY_TROUBLE = ::NS_COMPANY_TROUBLE,
  NT_COMPANY_MERGER = ::NS_COMPANY_MERGER, NT_COMPANY_BANKRUPT = ::NS_COMPANY_BANKRUPT, NT_COMPANY_NEW = ::NS_COMPANY_NEW, NT_INDUSTRY_OPEN = ::NS_INDUSTRY_OPEN,
  NT_INDUSTRY_CLOSE = ::NS_INDUSTRY_CLOSE, NT_ECONOMY = ::NS_ECONOMY, NT_INDUSTRY_COMPANY = ::NS_INDUSTRY_COMPANY, NT_INDUSTRY_OTHER = ::NS_INDUSTRY_OTHER,
  NT_INDUSTRY_NOBODY = ::NS_INDUSTRY_NOBODY, NT_ADVICE = ::NS_ADVICE, NT_NEW_VEHICLES = ::NS_NEW_VEHICLES, NT_ACCEPTANCE = ::NS_ACCEPTANCE,
  NT_SUBSIDIES = ::NS_SUBSIDIES, NT_GENERAL = ::NS_GENERAL
}
 

Enumeration for corners of tiles.

More...

Static Public Member Functions

static bool Create (NewsType type, Text *text, ScriptCompany::CompanyID company)
 Create a news messages for a company.

Detailed Description

Class that handles news messages.

game

Definition at line 23 of file script_news.hpp.


Member Enumeration Documentation

Enumeration for corners of tiles.

Enumerator:
NT_ARRIVAL_COMPANY 

Category arrival for own company.

NT_ARRIVAL_OTHER 

Category arrival for other companies.

NT_ACCIDENT 

Category accident.

NT_COMPANY_TROUBLE 

Category company in trouble.

NT_COMPANY_MERGER 

Category company merger.

NT_COMPANY_BANKRUPT 

Category company bankrupt.

NT_COMPANY_NEW 

Category company new.

NT_INDUSTRY_OPEN 

Category industry open.

NT_INDUSTRY_CLOSE 

Category industry close.

NT_ECONOMY 

Category economy.

NT_INDUSTRY_COMPANY 

Category industry changes for own company.

NT_INDUSTRY_OTHER 

Category industry changes for other companies.

NT_INDUSTRY_NOBODY 

Category industry changes for nobody.

NT_ADVICE 

Category advice.

NT_NEW_VEHICLES 

Category new vehicle.

NT_ACCEPTANCE 

Category acceptance changes.

NT_SUBSIDIES 

Category subsidies.

NT_GENERAL 

Category general.

Definition at line 28 of file script_news.hpp.


Member Function Documentation

bool ScriptNews::Create ( NewsType  type,
Text text,
ScriptCompany::CompanyID  company 
) [static]

Create a news messages for a company.

Parameters:
type The type of the news.
text The text message to show (can be either a raw string, or a ScriptText object).
company The company, or COMPANY_INVALID for all companies.
Returns:
True if the action succeeded.
Precondition:
text != NULL.
company == COMPANY_INVALID || ResolveCompanyID(company) != COMPANY_INVALID.

Definition at line 21 of file script_news.cpp.

References CMD_CUSTOM_NEWS_ITEM, ScriptCompany::COMPANY_INVALID, ScriptObject::DoCommand(), EnforcePrecondition, Text::GetEncodedText(), NR_NONE, NT_ARRIVAL_COMPANY, NT_GENERAL, ScriptCompany::ResolveCompanyID(), and StrEmpty().


The documentation for this class was generated from the following files: