Files
@ r15837:0edeb7d262a5
Branch filter:
Location: cpp/openttd-patchpack/source/src/ai/api/ai_event_types.hpp
r15837:0edeb7d262a5
22.3 KiB
text/x-c++hdr
(svn r20529) -Codechange: simplify UpdateAirplanesOnNewStation by removing code for situations that don't happen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 | /* $Id$ */
/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file ai_event_types.hpp The detailed types of all events. */
#ifndef AI_EVENT_TYPES_HPP
#define AI_EVENT_TYPES_HPP
#include "ai_object.hpp"
#include "ai_event.hpp"
#include "ai_company.hpp"
/**
* Event Vehicle Crash, indicating a vehicle of yours is crashed.
* It contains the crash site, the crashed vehicle and the reason for the crash.
*/
class AIEventVehicleCrashed : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventVehicleCrashed"; }
/**
* The reasons for vehicle crashes
*/
enum CrashReason {
CRASH_TRAIN, ///< Two trains collided
CRASH_RV_LEVEL_CROSSING, ///< Road vehicle got under a train
CRASH_RV_UFO, ///< Road vehicle got under a landing ufo
CRASH_PLANE_LANDING, ///< Plane crashed on landing
CRASH_AIRCRAFT_NO_AIRPORT, ///< Aircraft crashed after it found not a single airport for landing
CRASH_FLOODED, ///< Vehicle was flooded
};
/**
* @param vehicle The vehicle that crashed.
* @param crash_site Where the vehicle crashed.
* @param crash_reason The reason why the vehicle crashed.
*/
AIEventVehicleCrashed(VehicleID vehicle, TileIndex crash_site, CrashReason crash_reason) :
AIEvent(AI_ET_VEHICLE_CRASHED),
crash_site(crash_site),
vehicle(vehicle),
crash_reason(crash_reason)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventVehicleCrashed *Convert(AIEvent *instance) { return (AIEventVehicleCrashed *)instance; }
/**
* Get the VehicleID of the crashed vehicle.
* @return The crashed vehicle.
*/
VehicleID GetVehicleID() { return this->vehicle; }
/**
* Find the tile the vehicle crashed.
* @return The crash site.
*/
TileIndex GetCrashSite() { return this->crash_site; }
/**
* Get the reason for crashing
* @return The reason for crashing
*/
CrashReason GetCrashReason() { return this->crash_reason; }
private:
TileIndex crash_site;
VehicleID vehicle;
CrashReason crash_reason;
};
/**
* Event Subsidy Offered, indicating someone offered a subsidy.
*/
class AIEventSubsidyOffer : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventSubsidyOffer"; }
/**
* @param subsidy_id The index of this subsidy in the _subsidies array.
*/
AIEventSubsidyOffer(SubsidyID subsidy_id) :
AIEvent(AI_ET_SUBSIDY_OFFER),
subsidy_id(subsidy_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventSubsidyOffer *Convert(AIEvent *instance) { return (AIEventSubsidyOffer *)instance; }
/**
* Get the SubsidyID of the subsidy.
* @return The subsidy id.
*/
SubsidyID GetSubsidyID() { return this->subsidy_id; }
private:
SubsidyID subsidy_id;
};
/**
* Event Subsidy Offer Expired, indicating a subsidy will no longer be awarded.
*/
class AIEventSubsidyOfferExpired : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventSubsidyOfferExpired"; }
/**
* @param subsidy_id The index of this subsidy in the _subsidies array.
*/
AIEventSubsidyOfferExpired(SubsidyID subsidy_id) :
AIEvent(AI_ET_SUBSIDY_OFFER_EXPIRED),
subsidy_id(subsidy_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventSubsidyOfferExpired *Convert(AIEvent *instance) { return (AIEventSubsidyOfferExpired *)instance; }
/**
* Get the SubsidyID of the subsidy.
* @return The subsidy id.
*/
SubsidyID GetSubsidyID() { return this->subsidy_id; }
private:
SubsidyID subsidy_id;
};
/**
* Event Subidy Awarded, indicating a subsidy is awarded to some company.
*/
class AIEventSubsidyAwarded : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventSubsidyAwarded"; }
/**
* @param subsidy_id The index of this subsidy in the _subsidies array.
*/
AIEventSubsidyAwarded(SubsidyID subsidy_id) :
AIEvent(AI_ET_SUBSIDY_AWARDED),
subsidy_id(subsidy_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventSubsidyAwarded *Convert(AIEvent *instance) { return (AIEventSubsidyAwarded *)instance; }
/**
* Get the SubsidyID of the subsidy.
* @return The subsidy id.
*/
SubsidyID GetSubsidyID() { return this->subsidy_id; }
private:
SubsidyID subsidy_id;
};
/**
* Event Subsidy Expired, indicating a route that was once subsidized no longer is.
*/
class AIEventSubsidyExpired : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventSubsidyExpired"; }
/**
* @param subsidy_id The index of this subsidy in the _subsidies array.
*/
AIEventSubsidyExpired(SubsidyID subsidy_id) :
AIEvent(AI_ET_SUBSIDY_EXPIRED),
subsidy_id(subsidy_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventSubsidyExpired *Convert(AIEvent *instance) { return (AIEventSubsidyExpired *)instance; }
/**
* Get the SubsidyID of the subsidy.
* @return The subsidy id.
*/
SubsidyID GetSubsidyID() { return this->subsidy_id; }
private:
SubsidyID subsidy_id;
};
/**
* Event Engine Preview, indicating a manufacturer offer you to test a new engine.
* You can get the same information about the offered engine as a real user
* would see in the offer window. And you can also accept the offer.
*/
class AIEventEnginePreview : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventEnginePreview"; }
/**
* @param engine The engine offered to test.
*/
AIEventEnginePreview(EngineID engine) :
AIEvent(AI_ET_ENGINE_PREVIEW),
engine(engine)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventEnginePreview *Convert(AIEvent *instance) { return (AIEventEnginePreview *)instance; }
/**
* Get the name of the offered engine.
* @return The name the engine has.
*/
char *GetName();
/**
* Get the cargo-type of the offered engine. In case it can transport multiple cargos, it
* returns the first/main.
* @return The cargo-type of the engine.
*/
CargoID GetCargoType();
/**
* Get the capacity of the offered engine. In case it can transport multiple cargos, it
* returns the first/main.
* @return The capacity of the engine.
*/
int32 GetCapacity();
/**
* Get the maximum speed of the offered engine.
* @return The maximum speed the engine has.
* @note The speed is in OpenTTD's internal speed unit.
* This is mph / 1.6, which is roughly km/h.
* To get km/h multiply this number by 1.00584.
*/
int32 GetMaxSpeed();
/**
* Get the new cost of the offered engine.
* @return The new cost the engine has.
*/
Money GetPrice();
/**
* Get the running cost of the offered engine.
* @return The running cost of the vehicle per year.
* @note Cost is per year; divide by 365 to get per day.
*/
Money GetRunningCost();
#ifdef DOXYGEN_SKIP
/**
* Get the type of the offered engine.
* @return The type the engine has.
*/
AIVehicle::VehicleType GetVehicleType();
#else
int32 GetVehicleType();
#endif
/**
* Accept the engine preview.
* @return True when the accepting succeeded.
*/
bool AcceptPreview();
private:
EngineID engine;
};
/**
* Event Company New, indicating a new company has been created.
*/
class AIEventCompanyNew : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventCompanyNew"; }
/**
* @param owner The new company.
*/
AIEventCompanyNew(Owner owner) :
AIEvent(AI_ET_COMPANY_NEW),
owner((AICompany::CompanyID)owner)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventCompanyNew *Convert(AIEvent *instance) { return (AIEventCompanyNew *)instance; }
/**
* Get the CompanyID of the company that has been created.
* @return The CompanyID of the company.
*/
AICompany::CompanyID GetCompanyID() { return this->owner; }
private:
AICompany::CompanyID owner;
};
/**
* Event Company In Trouble, indicating a company is in trouble and might go
* bankrupt soon.
*/
class AIEventCompanyInTrouble : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventCompanyInTrouble"; }
/**
* @param owner The company that is in trouble.
*/
AIEventCompanyInTrouble(Owner owner) :
AIEvent(AI_ET_COMPANY_IN_TROUBLE),
owner((AICompany::CompanyID)owner)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventCompanyInTrouble *Convert(AIEvent *instance) { return (AIEventCompanyInTrouble *)instance; }
/**
* Get the CompanyID of the company that is in trouble.
* @return The CompanyID of the company in trouble.
*/
AICompany::CompanyID GetCompanyID() { return this->owner; }
private:
AICompany::CompanyID owner;
};
/**
* Event Company Ask Merger, indicating a company can be bought (cheaply) by you.
*/
class AIEventCompanyAskMerger : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventCompanyAskMerger"; }
/**
* @param owner The company that can be bough.
* @param value The value/costs of buying the company.
*/
AIEventCompanyAskMerger(Owner owner, int32 value) :
AIEvent(AI_ET_COMPANY_MERGER),
owner((AICompany::CompanyID)owner),
value(value)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventCompanyAskMerger *Convert(AIEvent *instance) { return (AIEventCompanyAskMerger *)instance; }
/**
* Get the CompanyID of the company that can be bought.
* @return The CompanyID of the company that can be bought.
* @note If the company is bought this will become invalid.
*/
AICompany::CompanyID GetCompanyID() { return this->owner; }
/**
* Get the value of the new company.
* @return The value of the new company.
*/
int32 GetValue() { return this->value; }
/**
* Take over the company for this merger.
* @return true if the merger was a success.
*/
bool AcceptMerger();
private:
AICompany::CompanyID owner;
int32 value;
};
/**
* Event Company Merger, indicating a company has been bought by another
* company.
*/
class AIEventCompanyMerger : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventCompanyMerger"; }
/**
* @param old_owner The company bought off.
* @param new_owner The company that bougth owner.
*/
AIEventCompanyMerger(Owner old_owner, Owner new_owner) :
AIEvent(AI_ET_COMPANY_MERGER),
old_owner((AICompany::CompanyID)old_owner),
new_owner((AICompany::CompanyID)new_owner)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventCompanyMerger *Convert(AIEvent *instance) { return (AIEventCompanyMerger *)instance; }
/**
* Get the CompanyID of the company that has been bought.
* @return The CompanyID of the company that has been bought.
* @note: The value below is not valid anymore as CompanyID, and
* AICompany::ResolveCompanyID will return COMPANY_COMPANY. It's
* only usefull if you're keeping track of company's yourself.
*/
AICompany::CompanyID GetOldCompanyID() { return this->old_owner; }
/**
* Get the CompanyID of the new owner.
* @return The CompanyID of the new owner.
*/
AICompany::CompanyID GetNewCompanyID() { return this->new_owner; }
private:
AICompany::CompanyID old_owner;
AICompany::CompanyID new_owner;
};
/**
* Event Company Bankrupt, indicating a company has gone bankrupt.
*/
class AIEventCompanyBankrupt : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventCompanyBankrupt"; }
/**
* @param owner The company that has gone bankrupt.
*/
AIEventCompanyBankrupt(Owner owner) :
AIEvent(AI_ET_COMPANY_BANKRUPT),
owner((AICompany::CompanyID)owner)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventCompanyBankrupt *Convert(AIEvent *instance) { return (AIEventCompanyBankrupt *)instance; }
/**
* Get the CompanyID of the company that has gone bankrupt.
* @return The CompanyID of the company that has gone bankrupt.
*/
AICompany::CompanyID GetCompanyID() { return this->owner; }
private:
AICompany::CompanyID owner;
};
/**
* Event Vehicle Lost, indicating a vehicle can't find its way to its destination.
*/
class AIEventVehicleLost : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventVehicleLost"; }
/**
* @param vehicle_id The vehicle that is lost.
*/
AIEventVehicleLost(VehicleID vehicle_id) :
AIEvent(AI_ET_VEHICLE_LOST),
vehicle_id(vehicle_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventVehicleLost *Convert(AIEvent *instance) { return (AIEventVehicleLost *)instance; }
/**
* Get the VehicleID of the vehicle that is lost.
* @return The VehicleID of the vehicle that is lost.
*/
VehicleID GetVehicleID() { return this->vehicle_id; }
private:
VehicleID vehicle_id;
};
/**
* Event VehicleWaitingInDepot, indicating a vehicle has arrived a depot and is now waiting there.
*/
class AIEventVehicleWaitingInDepot : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventVehicleWaitingInDepot"; }
/**
* @param vehicle_id The vehicle that is waiting in a depot.
*/
AIEventVehicleWaitingInDepot(VehicleID vehicle_id) :
AIEvent(AI_ET_VEHICLE_WAITING_IN_DEPOT),
vehicle_id(vehicle_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventVehicleWaitingInDepot *Convert(AIEvent *instance) { return (AIEventVehicleWaitingInDepot *)instance; }
/**
* Get the VehicleID of the vehicle that is waiting in a depot.
* @return The VehicleID of the vehicle that is waiting in a depot.
*/
VehicleID GetVehicleID() { return this->vehicle_id; }
private:
VehicleID vehicle_id;
};
/**
* Event Vehicle Unprofitable, indicating a vehicle lost money last year.
*/
class AIEventVehicleUnprofitable : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventVehicleUnprofitable"; }
/**
* @param vehicle_id The vehicle that was unprofitable.
*/
AIEventVehicleUnprofitable(VehicleID vehicle_id) :
AIEvent(AI_ET_VEHICLE_UNPROFITABLE),
vehicle_id(vehicle_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventVehicleUnprofitable *Convert(AIEvent *instance) { return (AIEventVehicleUnprofitable *)instance; }
/**
* Get the VehicleID of the vehicle that lost money.
* @return The VehicleID of the vehicle that lost money.
*/
VehicleID GetVehicleID() { return this->vehicle_id; }
private:
VehicleID vehicle_id;
};
/**
* Event Industry Open, indicating a new industry has been created.
*/
class AIEventIndustryOpen : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventIndustryOpen"; }
/**
* @param industry_id The new industry.
*/
AIEventIndustryOpen(IndustryID industry_id) :
AIEvent(AI_ET_INDUSTRY_OPEN),
industry_id(industry_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventIndustryOpen *Convert(AIEvent *instance) { return (AIEventIndustryOpen *)instance; }
/**
* Get the IndustryID of the new industry.
* @return The IndustryID of the industry.
*/
IndustryID GetIndustryID() { return this->industry_id; }
private:
IndustryID industry_id;
};
/**
* Event Industry Close, indicating an industry is going to be closed.
*/
class AIEventIndustryClose : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventIndustryClose"; }
/**
* @param industry_id The new industry.
*/
AIEventIndustryClose(IndustryID industry_id) :
AIEvent(AI_ET_INDUSTRY_CLOSE),
industry_id(industry_id)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventIndustryClose *Convert(AIEvent *instance) { return (AIEventIndustryClose *)instance; }
/**
* Get the IndustryID of the closing industry.
* @return The IndustryID of the industry.
*/
IndustryID GetIndustryID() { return this->industry_id; }
private:
IndustryID industry_id;
};
/**
* Event Engine Available, indicating a new engine is available.
*/
class AIEventEngineAvailable : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventEngineAvailable"; }
/**
* @param engine The engine that is available.
*/
AIEventEngineAvailable(EngineID engine) :
AIEvent(AI_ET_ENGINE_AVAILABLE),
engine(engine)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventEngineAvailable *Convert(AIEvent *instance) { return (AIEventEngineAvailable *)instance; }
/**
* Get the EngineID of the new engine.
* @return The EngineID of the new engine.
*/
EngineID GetEngineID() { return this->engine; }
private:
EngineID engine;
};
/**
* Event Station First Vehicle, indicating a station has been visited by a vehicle for the first time.
*/
class AIEventStationFirstVehicle : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventStationFirstVehicle"; }
/**
* @param station The station visited for the first time.
* @param vehicle The vehicle visiting the station.
*/
AIEventStationFirstVehicle(StationID station, VehicleID vehicle) :
AIEvent(AI_ET_STATION_FIRST_VEHICLE),
station(station),
vehicle(vehicle)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventStationFirstVehicle *Convert(AIEvent *instance) { return (AIEventStationFirstVehicle *)instance; }
/**
* Get the StationID of the visited station.
* @return The StationID of the visited station.
*/
StationID GetStationID() { return this->station; }
/**
* Get the VehicleID of the first vehicle.
* @return The VehicleID of the first vehicle.
*/
VehicleID GetVehicleID() { return this->vehicle; }
private:
StationID station;
VehicleID vehicle;
};
/**
* Event Disaster Zeppeliner Crashed, indicating a zeppeliner has crashed on an airport and is blocking the runway.
*/
class AIEventDisasterZeppelinerCrashed : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventDisasterZeppelinerCrashed"; }
/**
* @param station The station containing the affected airport
*/
AIEventDisasterZeppelinerCrashed(StationID station) :
AIEvent(AI_ET_DISASTER_ZEPPELINER_CRASHED),
station(station)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventDisasterZeppelinerCrashed *Convert(AIEvent *instance) { return (AIEventDisasterZeppelinerCrashed *)instance; }
/**
* Get the StationID of the station containing the affected airport.
* @return The StationID of the station containing the affected airport.
*/
StationID GetStationID() { return this->station; }
private:
StationID station;
};
/**
* Event Disaster Zeppeliner Cleared, indicating a previously crashed zeppeliner has been removed, and the airport is operating again.
*/
class AIEventDisasterZeppelinerCleared : public AIEvent {
public:
/** Get the name of this class to identify it towards squirrel. */
static const char *GetClassName() { return "AIEventDisasterZeppelinerCleared"; }
/**
* @param station The station containing the affected airport
*/
AIEventDisasterZeppelinerCleared(StationID station) :
AIEvent(AI_ET_DISASTER_ZEPPELINER_CLEARED),
station(station)
{}
/**
* Convert an AIEvent to the real instance.
* @param instance The instance to convert.
* @return The converted instance.
*/
static AIEventDisasterZeppelinerCleared *Convert(AIEvent *instance) { return (AIEventDisasterZeppelinerCleared *)instance; }
/**
* Get the StationID of the station containing the affected airport.
* @return The StationID of the station containing the affected airport.
*/
StationID GetStationID() { return this->station; }
private:
StationID station;
};
#endif /* AI_EVENT_TYPES_HPP */
|