rubidium - 12 years ago 2012-01-20 20:18:19 rubidium@openttd.org
(svn r23826) -Fix [FS#4972]: the detailed performance rating window showed the cargo count of the current quarter instead of the last quarter like the tooltip says
9 files changed with 54 insertions and 33 deletions:
for (size_t i = 0; i < lengthof(this->amount); i++) {
ret += this->amount[i];
}
return ret;
}
/**
* Get the amount of cargos that have an amount.
* @return The amount.
*/
inline byte GetCount() const
{
byte count = 0;
for (size_t i = 0; i < lengthof(this->amount); i++) {
if (this->amount[i] != 0) count++;
}
return count;
}
};
/** Types of cargo source and destination */
enum SourceType {
ST_INDUSTRY, ///< Source/destination is an industry
ST_TOWN, ///< Source/destination is a town
ST_HEADQUARTERS, ///< Source/destination are company headquarters
};
typedef SimpleTinyEnumT<SourceType, byte> SourceTypeByte; ///< The SourceType packed into a byte for savegame purposes.
typedef uint16 SourceID; ///< Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
static const SourceID INVALID_SOURCE = 0xFFFF; ///< Invalid/unknown index of source
#endif /* CARGO_TYPE_H */
src/company_base.h
➞
Show inline comments
/* $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 company_base.h Definition of stuff that is very close to a company, like the company struct itself. */
#ifndef COMPANY_BASE_H
#define COMPANY_BASE_H
#include "road_type.h"
#include "livery.h"
#include "autoreplace_type.h"
#include "tile_type.h"
#include "settings_type.h"
#include "group.h"
/** Statistics about the economy. */
struct CompanyEconomyEntry {
Money income;
Money expenses;
int32 delivered_cargo;
int32 performance_history; ///< company score (scale 0-1000)
Money company_value;
Money income; ///< The amount of income.
Money expenses; ///< The amount of expenses.
CargoArray delivered_cargo; ///< The amount of delivered cargo.
int32 performance_history; ///< Company score (scale 0-1000)
Money company_value; ///< The value of the company.
};
struct CompanyInfrastructure {
uint32 road[ROADTYPE_END]; ///< Count of company owned track bits for each road type.
uint32 signal; ///< Count of company owned signals.
uint32 rail[RAILTYPE_END]; ///< Count of company owned track bits for each rail type.
uint32 water; ///< Count of company owned track bits for canals.
uint32 station; ///< Count of company owned station tiles.
uint32 airport; ///< Count of company owned airports.