# AIEventCompanyAskMerger Class Reference

Event Company Ask Merger, indicating a company can be bought (cheaply) by you. More...

`#include <ai_event_types.hpp>`

Inheritance diagram for AIEventCompanyAskMerger:

## Public Member Functions
| AIEventCompanyAskMerger (Owner owner, int32 value)
AICompany::CompanyID | GetCompanyID ()
| Get the CompanyID of the company that can be bought.
int32 | GetValue ()
| Get the value of the new company.
bool | AcceptMerger ()
| Take over the company for this merger.
## Static Public Member Functions
static const char * | GetClassName ()
static AIEventCompanyAskMerger * | Convert (AIEvent *instance)
| Convert an AIEvent to the real instance.
## Private Attributes
AICompany::CompanyID | owner
int32 | value

## Detailed Description

Event Company Ask Merger, indicating a company can be bought (cheaply) by you.

Definition at line 364 of file ai_event_types.hpp.

## Constructor & Destructor Documentation

AIEventCompanyAskMerger::AIEventCompanyAskMerger | ( | Owner | owner,
|  | int32 | value |
| ) |  |  | `[inline]`

Parameters:

  | owner | The company that can be bough.
  | value | The value/costs of buying the company.

Definition at line 372 of file ai_event_types.hpp.

## Member Function Documentation

static AIEventCompanyAskMerger* AIEventCompanyAskMerger::Convert | ( | AIEvent * | instance | ) | `[inline, static]`

Convert an AIEvent to the real instance.

Parameters:

  | instance | The instance to convert.

Returns:
  The converted instance.

Definition at line 383 of file ai_event_types.hpp.

AICompany::CompanyID AIEventCompanyAskMerger::GetCompanyID | ( |  | ) | `[inline]`

Get the CompanyID of the company that can be bought.

Returns:
  The CompanyID of the company that can be bought.

Note:
  If the company is bought this will become invalid.

Definition at line 390 of file ai_event_types.hpp.

int32 AIEventCompanyAskMerger::GetValue | ( |  | ) | `[inline]`

Get the value of the new company.

Returns:
  The value of the new company.

Definition at line 396 of file ai_event_types.hpp.

bool AIEventCompanyAskMerger::AcceptMerger | ( |  | ) |

Take over the company for this merger.

Returns:
  true if the merger was a success.

Definition at line 104 of file ai_event_types.cpp.

References CMD_BUY_COMPANY, and AIObject::DoCommand().

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

- src/ai/api/ai_event_types.hpp
- src/ai/api/ai_event_types.cpp