mirror of https://github.com/OpenTTD/OpenTTD
(svn r20326) -Codechange: move UnmovableType to its own file
parent
5ae4e27446
commit
55129f1fbb
|
@ -578,6 +578,7 @@
|
||||||
<ClInclude Include="..\src\transport_type.h" />
|
<ClInclude Include="..\src\transport_type.h" />
|
||||||
<ClInclude Include="..\src\tunnelbridge.h" />
|
<ClInclude Include="..\src\tunnelbridge.h" />
|
||||||
<ClInclude Include="..\src\unmovable.h" />
|
<ClInclude Include="..\src\unmovable.h" />
|
||||||
|
<ClInclude Include="..\src\unmovable_type.h" />
|
||||||
<ClInclude Include="..\src\vehicle_base.h" />
|
<ClInclude Include="..\src\vehicle_base.h" />
|
||||||
<ClInclude Include="..\src\vehicle_func.h" />
|
<ClInclude Include="..\src\vehicle_func.h" />
|
||||||
<ClInclude Include="..\src\vehicle_gui.h" />
|
<ClInclude Include="..\src\vehicle_gui.h" />
|
||||||
|
|
|
@ -937,6 +937,9 @@
|
||||||
<ClInclude Include="..\src\unmovable.h">
|
<ClInclude Include="..\src\unmovable.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\src\unmovable_type.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\src\vehicle_base.h">
|
<ClInclude Include="..\src\vehicle_base.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
|
@ -1579,6 +1579,10 @@
|
||||||
RelativePath=".\..\src\unmovable.h"
|
RelativePath=".\..\src\unmovable.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\..\src\unmovable_type.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\..\src\vehicle_base.h"
|
RelativePath=".\..\src\vehicle_base.h"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1576,6 +1576,10 @@
|
||||||
RelativePath=".\..\src\unmovable.h"
|
RelativePath=".\..\src\unmovable.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\..\src\unmovable_type.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\..\src\vehicle_base.h"
|
RelativePath=".\..\src\vehicle_base.h"
|
||||||
>
|
>
|
||||||
|
|
|
@ -304,6 +304,7 @@ transparency_gui.h
|
||||||
transport_type.h
|
transport_type.h
|
||||||
tunnelbridge.h
|
tunnelbridge.h
|
||||||
unmovable.h
|
unmovable.h
|
||||||
|
unmovable_type.h
|
||||||
vehicle_base.h
|
vehicle_base.h
|
||||||
vehicle_func.h
|
vehicle_func.h
|
||||||
vehicle_gui.h
|
vehicle_gui.h
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
#include "economy_func.h"
|
#include "economy_func.h"
|
||||||
#include "strings_type.h"
|
#include "strings_type.h"
|
||||||
|
#include "unmovable_type.h"
|
||||||
|
|
||||||
void UpdateCompanyHQ(Company *c, uint score);
|
void UpdateCompanyHQ(Company *c, uint score);
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ struct UnmovableSpec {
|
||||||
* @param index The unmovable type to fetch.
|
* @param index The unmovable type to fetch.
|
||||||
* @return The specification.
|
* @return The specification.
|
||||||
*/
|
*/
|
||||||
static const UnmovableSpec *Get(int index);
|
static const UnmovableSpec *Get(UnmovableType index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the specification associated with a tile.
|
* Get the specification associated with a tile.
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/unmovable_land.h"
|
#include "table/unmovable_land.h"
|
||||||
|
|
||||||
/* static */ const UnmovableSpec *UnmovableSpec::Get(int index)
|
/* static */ const UnmovableSpec *UnmovableSpec::Get(UnmovableType index)
|
||||||
{
|
{
|
||||||
assert(index < UNMOVABLE_MAX);
|
assert(index < UNMOVABLE_MAX);
|
||||||
return &_original_unmovable[index];
|
return &_original_unmovable[index];
|
||||||
|
|
|
@ -13,16 +13,7 @@
|
||||||
#define UNMOVABLE_MAP_H
|
#define UNMOVABLE_MAP_H
|
||||||
|
|
||||||
#include "tile_map.h"
|
#include "tile_map.h"
|
||||||
|
#include "unmovable_type.h"
|
||||||
/** Types of unmovable structure */
|
|
||||||
enum UnmovableType {
|
|
||||||
UNMOVABLE_TRANSMITTER = 0, ///< The large antenna
|
|
||||||
UNMOVABLE_LIGHTHOUSE = 1, ///< The nice lighthouse
|
|
||||||
UNMOVABLE_STATUE = 2, ///< Statue in towns
|
|
||||||
UNMOVABLE_OWNED_LAND = 3, ///< Owned land 'flag'
|
|
||||||
UNMOVABLE_HQ = 4, ///< HeadQuarter of a player
|
|
||||||
UNMOVABLE_MAX,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the UnmovableType of the given unmovable tile
|
* Gets the UnmovableType of the given unmovable tile
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
/* $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 unmovable_map.h Types related to unmovable tiles. */
|
||||||
|
|
||||||
|
#ifndef UNMOVABLE_TYPE_H
|
||||||
|
#define UNMOVABLE_TYPE_H
|
||||||
|
|
||||||
|
/** Types of unmovable structure */
|
||||||
|
enum UnmovableType {
|
||||||
|
UNMOVABLE_TRANSMITTER = 0, ///< The large antenna
|
||||||
|
UNMOVABLE_LIGHTHOUSE = 1, ///< The nice lighthouse
|
||||||
|
UNMOVABLE_STATUE = 2, ///< Statue in towns
|
||||||
|
UNMOVABLE_OWNED_LAND = 3, ///< Owned land 'flag'
|
||||||
|
UNMOVABLE_HQ = 4, ///< HeadQuarter of a player
|
||||||
|
UNMOVABLE_MAX,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct UnmovableSpec;
|
||||||
|
|
||||||
|
#endif /* UNMOVABLE_MAP_H */
|
Loading…
Reference in New Issue