# signal_func.h

Go to the documentation of this file.

    00001 /* $Id: signal_func.h 14840 2009-01-04 21:02:59Z glx $ */
    00002
    00005 #ifndef SIGNAL_FUNC_H
    00006 #define SIGNAL_FUNC_H
    00007
    00008 #include "track_type.h"
    00009 #include "tile_type.h"
    00010 #include "direction_type.h"
    00011 #include "company_type.h"
    00012
    00017 static inline byte SignalAlongTrackdir(Trackdir trackdir)
    00018 {
    00019   extern const byte _signal_along_trackdir[TRACKDIR_END];
    00020   return _signal_along_trackdir[trackdir];
    00021 }
    00022
    00027 static inline byte SignalAgainstTrackdir(Trackdir trackdir)
    00028 {
    00029   extern const byte _signal_against_trackdir[TRACKDIR_END];
    00030   return _signal_against_trackdir[trackdir];
    00031 }
    00032
    00037 static inline byte SignalOnTrack(Track track)
    00038 {
    00039   extern const byte _signal_on_track[TRACK_END];
    00040   return _signal_on_track[track];
    00041 }
    00042
    00044 enum SigSegState {
    00045   SIGSEG_FREE,
    00046   SIGSEG_FULL,
    00047   SIGSEG_PBS,
    00048 };
    00049
    00050 SigSegState UpdateSignalsOnSegment(TileIndex tile, DiagDirection side, Owner owner);
    00051 void SetSignalsOnBothDir(TileIndex tile, Track track, Owner owner);
    00052 void AddTrackToSignalBuffer(TileIndex tile, Track track, Owner owner);
    00053 void AddSideToSignalBuffer(TileIndex tile, DiagDirection side, Owner owner);
    00054 void UpdateSignalsInBuffer();
    00055
    00056 #endif /* SIGNAL_FUNC_H */