src/company_func.h
author terom@frrb.lan
Fri, 19 Dec 2008 01:38:09 +0200
changeset 10439 50f056aa3024
parent 10225 eb61dd8101c1
permissions -rw-r--r--
industries, unmoveables... everything but the landscape
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
     1
/* $Id$ */
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
     2
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
     3
/** @file company_func.h Functions related to companies. */
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
     4
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
     5
#ifndef COMPANY_FUNC_H
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
     6
#define COMPANY_FUNC_H
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
     7
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
     8
#include "core/math_func.hpp"
10208
72c00af5c95d (svn r14422) -Codechange: also reflect the changes of r14421 in the filenames.
rubidium
parents: 10207
diff changeset
     9
#include "company_type.h"
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    10
#include "tile_type.h"
8264
b1e85998c7d3 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h.
rubidium
parents: 8254
diff changeset
    11
#include "strings_type.h"
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    12
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    13
void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner);
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    14
void GetNameOfOwner(Owner owner, TileIndex tile);
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    15
void SetLocalCompany(CompanyID new_company);
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    16
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    17
extern CompanyByte _local_company;
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    18
extern CompanyByte _current_company;
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    19
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    20
extern byte _company_colours[MAX_COMPANIES];     ///< NOSAVE: can be determined from company structs
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    21
extern CompanyManagerFace _company_manager_face; ///< for company manager face storage in openttd.cfg
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    22
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    23
bool IsHumanCompany(CompanyID company);
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    24
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    25
static inline bool IsLocalCompany()
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    26
{
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    27
	return _local_company == _current_company;
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    28
}
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    29
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    30
static inline bool IsInteractiveCompany(CompanyID company)
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    31
{
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    32
	return company == _local_company;
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    33
}
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    34
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    35
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    36
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    37
struct HighScore {
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    38
	char company[100];
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    39
	StringID title; ///< NOSAVE, has troubles with changing string-numbers.
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    40
	uint16 score;   ///< do NOT change type, will break hs.dat
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    41
};
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    42
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    43
extern HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    44
void SaveToHighScore();
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    45
void LoadFromHighScore();
10225
eb61dd8101c1 (svn r14448) -Codechange [FS#2328]: rename a few variables (based on a patch by planetmaker)
smatz
parents: 10208
diff changeset
    46
int8 SaveHighScoreValue(const Company *c);
8254
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    47
int8 SaveHighScoreValueNetwork();
1496654ca5e7 (svn r11818) -Codechange: split player.h into smaller pieces.
rubidium
parents:
diff changeset
    48
10207
c291a21b304e (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium
parents: 9659
diff changeset
    49
#endif /* COMPANY_FUNC_H */