--- a/src/ai/NoAI/NoAI.cpp Mon Mar 03 16:15:24 2008 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/* $Id$ */
-
-/** @file NoAI.cpp a simple C++ AI that will never be an AI */
-
-#include "../../stdafx.h"
-#include "NoAI.hpp"
-
-static FNoAI iFNoAI; ///< Tell the AI-core that we have an AI with which we like to play.
-
-/* Define the GameLoop. This is called every tick. */
-void NoAI::GameLoop()
-{
- if (this->GetTick() == 1) {
- if (!this->company.SetCompanyName("NoAI")) {
- char name[32];
- snprintf(name, lengthof(name), "NoAI %d", this->base.Rand());
- this->company.SetCompanyName(name);
- }
- printf("Map size: %d by %d, %d tiles\n", this->map.GetMapSizeX(),
- this->map.GetMapSizeY(), this->map.GetMapSize());
- }
-
- if (this->GetTick() < 10) {
- char *cargo_label = this->cargo.GetCargoLabel(this->GetTick());
- printf("%s is %sfreight and the income is %d per 20 tiles in 10 days\n",
- cargo_label, this->cargo.IsFreight(this->GetTick()) ? "" : "not ",
- this->cargo.GetCargoIncome(20, 10, this->GetTick()));
- free(cargo_label);
- }
-
- if (this->GetTick() < this->industry.GetMaxIndustryID()) {
- if (this->industry.IsValidIndustry(this->GetTick())) {
- char *industry_name = this->industry.GetName(this->GetTick());
- TileIndex t = this->industry.GetLocation(this->GetTick());
-
- printf("Industry %s [%d of %d] at (%d, %d)\n",
- industry_name, this->GetTick(), this->industry.GetIndustryCount(),
- this->map.GetTileX(t), this->map.GetTileY(t));
- }
- }
-
- if (this->GetTick() % 10 == 0) {
- char *company_name = this->company.GetCompanyName(AICompany::MY_COMPANY);
- printf("%s has loaned %d\n", company_name, this->company.GetLoanAmount());
- free(company_name);
- }
-
- if (this->GetTick() % 14 == 0) {
- uint level = (this->company.GetMaxLoanAmount() / this->company.GetLoanInterval()) + 1;
- this->company.SetLoanAmount(this->base.RandRange(level) * this->company.GetLoanInterval());
- }
-
- if (this->GetTick() % 13 == 0) {
- TownID town_id = this->base.RandRange(this->town.GetMaxTownID());
- if (this->town.IsValidTown(town_id)) {
- char *town_name = this->town.GetName(town_id);
- TileIndex t = this->town.GetLocation(town_id);
-
- printf("Town %s [%d of %d] at (%d, %d) with %d inhabitants\n",
- town_name, town_id, this->town.GetTownCount(),
- this->map.GetTileX(t), this->map.GetTileY(t),
- this->town.GetPopulation(town_id));
- }
- }
-}
-
-/* virtual */ void NoAI::Start()
-{
- this->stop = false;
- while (!stop) {
- this->Sleep(1);
- this->GameLoop();
- }
-}
-
-/* virtual */ void NoAI::Stop()
-{
- this->stop = true;
-}