src/road_internal.h
author belugas
Tue, 17 Jun 2008 02:33:42 +0000
changeset 10987 4271189aa492
parent 10690 2a363031721a
permissions -rw-r--r--
(svn r13541) -Codechange: Aligning some switch case. Code cosmetics.
3069
0e6aca11c3da (svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
tron
parents:
diff changeset
     1
/* $Id$ */
0e6aca11c3da (svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
tron
parents:
diff changeset
     2
8598
14ae80fe4c8f (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents: 8424
diff changeset
     3
/** @file road_internal.h Functions used internally by the roads. */
7157
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
     4
8598
14ae80fe4c8f (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents: 8424
diff changeset
     5
#ifndef ROAD_INTERNAL_H
14ae80fe4c8f (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents: 8424
diff changeset
     6
#define ROAD_INTERNAL_H
6335
0c3dc188f099 (svn r8730) -Codechange: more replacements of magic numbers by enums and removal of some (by now) redundant comments.
rubidium
parents: 5838
diff changeset
     7
8634
5ffca02f9115 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents: 8598
diff changeset
     8
#include "tile_cmd.h"
5ffca02f9115 (svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents: 8598
diff changeset
     9
6442
10b44714b85d (svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
rubidium
parents: 6335
diff changeset
    10
/**
8137
67a9579abd74 (svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents: 8062
diff changeset
    11
 * Clean up unneccesary RoadBits of a planed tile.
67a9579abd74 (svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents: 8062
diff changeset
    12
 * @param tile current tile
67a9579abd74 (svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents: 8062
diff changeset
    13
 * @param org_rb planed RoadBits
67a9579abd74 (svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents: 8062
diff changeset
    14
 * @return optimised RoadBits
67a9579abd74 (svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents: 8062
diff changeset
    15
 */
67a9579abd74 (svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents: 8062
diff changeset
    16
RoadBits CleanUpRoadBits(const TileIndex tile, RoadBits org_rb);
67a9579abd74 (svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents: 8062
diff changeset
    17
67a9579abd74 (svn r11172) -Codechange: rewrite of town road building and addition of the possibility to clean up unconnected road bits during the local road reconstructions. Based on a patch by skidd13.
rubidium
parents: 8062
diff changeset
    18
/**
6442
10b44714b85d (svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
rubidium
parents: 6335
diff changeset
    19
 * Is it allowed to remove the given road bits from the given tile?
10b44714b85d (svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
rubidium
parents: 6335
diff changeset
    20
 * @param tile      the tile to remove the road from
10b44714b85d (svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
rubidium
parents: 6335
diff changeset
    21
 * @param remove    the roadbits that are going to be removed
10b44714b85d (svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
rubidium
parents: 6335
diff changeset
    22
 * @param owner     the actual owner of the roadbits of the tile
7157
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    23
 * @param rt        the road type to remove the bits from
10690
2a363031721a (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9317
diff changeset
    24
 * @param flags     command flags
2a363031721a (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9317
diff changeset
    25
 * @param town_check Shall the town rating checked/affected
6442
10b44714b85d (svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
rubidium
parents: 6335
diff changeset
    26
 * @return true when it is allowed to remove the road bits
10b44714b85d (svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
rubidium
parents: 6335
diff changeset
    27
 */
10690
2a363031721a (svn r13234) -Fix: Check/affect town rating when removing/bulldozing town-owned road under drivethrough stops.
frosch
parents: 9317
diff changeset
    28
bool CheckAllowRemoveRoad(TileIndex tile, RoadBits remove, Owner owner, RoadType rt, uint32 flags, bool town_check = true);
6442
10b44714b85d (svn r8852) -Fix (r8735): make the dynamite tool for drive through road stops as if it were removing a normal road tile (consider the local authority and such).
rubidium
parents: 6335
diff changeset
    29
7891
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    30
/**
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    31
 * Draw the catenary for tram road bits
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    32
 * @param ti   information about the tile (position, slope)
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    33
 * @param tram the roadbits to draw the catenary for
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    34
 */
9317
191b8b10e545 (svn r12569) -Cleanup: variable scope and coding style in road*.cpp
smatz
parents: 8634
diff changeset
    35
void DrawTramCatenary(const TileInfo *ti, RoadBits tram);
7187
f7dc3204d457 (svn r9923) -Add: support for Action 0 Road vehicles, property 1C, bit 0.
rubidium
parents: 7157
diff changeset
    36
8598
14ae80fe4c8f (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents: 8424
diff changeset
    37
#endif /* ROAD_INTERNAL_H */