industry_map.h
author Darkvater
Sun, 26 Mar 2006 16:29:20 +0000
changeset 3335 caea2aff4db6
parent 3331 da6bbabbb6cc
child 3369 cab209754317
permissions -rw-r--r--
(svn r4114) - Add missing source files to VS2003/VS6 project files added in r4113
3314
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     1
/* $Id$ */
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     2
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     3
#include "industry.h"
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     4
#include "macros.h"
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     5
#include "tile.h"
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     6
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     7
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     8
static inline uint GetIndustryIndex(TileIndex t)
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
     9
{
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    10
	return _m[t].m2;
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    11
}
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    12
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    13
static inline Industry* GetIndustryByTile(TileIndex t)
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    14
{
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    15
	return GetIndustry(GetIndustryIndex(t));
6aaeba4b92e8 (svn r4077) Add GetIndustry{Index,ByTile}() to get the industry index resp. the industry from a tile
tron
parents:
diff changeset
    16
}
3320
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    17
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    18
3321
4061bfef1830 (svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents: 3320
diff changeset
    19
static inline bool IsIndustryCompleted(TileIndex tile)
4061bfef1830 (svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents: 3320
diff changeset
    20
{
4061bfef1830 (svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents: 3320
diff changeset
    21
	return HASBIT(_m[tile].m1, 7);
4061bfef1830 (svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents: 3320
diff changeset
    22
}
4061bfef1830 (svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents: 3320
diff changeset
    23
4061bfef1830 (svn r4087) Add IsIndustryCompleted() to check if a industry tile is fully built
tron
parents: 3320
diff changeset
    24
3331
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    25
static inline uint GetIndustryGfx(TileIndex t)
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    26
{
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    27
	return _m[t].m5;
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    28
}
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    29
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    30
static inline void SetIndustryGfx(TileIndex t, uint gfx)
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    31
{
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    32
	_m[t].m5 = gfx;
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    33
}
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    34
da6bbabbb6cc (svn r4108) Add [GS]etIndustryGfx()
tron
parents: 3321
diff changeset
    35
3320
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    36
static inline void MakeIndustry(TileIndex t, uint index, uint gfx)
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    37
{
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    38
	SetTileType(t, MP_INDUSTRY);
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    39
	_m[t].m1 = 0;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    40
	_m[t].m2 = index;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    41
	_m[t].m3 = 0;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    42
	_m[t].m4 = 0;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    43
	_m[t].m5 = gfx;
e9e284ab853a (svn r4086) Add MakeIndustry()
tron
parents: 3314
diff changeset
    44
}