(svn r20286) -Codechange: Unify end of doxygen comments.
This commit is contained in:
@@ -24,7 +24,8 @@
|
||||
/**
|
||||
* Track follower helper template class (can serve pathfinders and vehicle
|
||||
* controllers). See 6 different typedefs below for 3 different transport
|
||||
* types w/ or w/o 90-deg turns allowed */
|
||||
* types w/ or w/o 90-deg turns allowed
|
||||
*/
|
||||
template <TransportType Ttr_type_, typename VehicleType, bool T90deg_turns_allowed_ = true, bool Tmask_reserved_tracks = false>
|
||||
struct CFollowTrackT
|
||||
{
|
||||
@@ -113,7 +114,8 @@ struct CFollowTrackT
|
||||
|
||||
/**
|
||||
* main follower routine. Fills all members and return true on success.
|
||||
* Otherwise returns false if track can't be followed. */
|
||||
* Otherwise returns false if track can't be followed.
|
||||
*/
|
||||
inline bool Follow(TileIndex old_tile, Trackdir old_td)
|
||||
{
|
||||
m_old_tile = old_tile;
|
||||
|
@@ -100,7 +100,8 @@ void init_InsSort(Queue *q);
|
||||
|
||||
/**
|
||||
* Initializes a binary heap and allocates internal memory for maximum of
|
||||
* max_size elements */
|
||||
* max_size elements
|
||||
*/
|
||||
void init_BinaryHeap(Queue *q, uint max_size);
|
||||
|
||||
|
||||
@@ -137,22 +138,26 @@ struct Hash {
|
||||
/**
|
||||
* Deletes the value with the specified key pair from the hash and returns
|
||||
* that value. Returns NULL when the value was not present. The value returned
|
||||
* is _not_ free()'d! */
|
||||
* is _not_ free()'d!
|
||||
*/
|
||||
void *Hash_Delete(Hash *h, uint key1, uint key2);
|
||||
/**
|
||||
* Sets the value associated with the given key pair to the given value.
|
||||
* Returns the old value if the value was replaced, NULL when it was not yet present. */
|
||||
* Returns the old value if the value was replaced, NULL when it was not yet present.
|
||||
*/
|
||||
void *Hash_Set(Hash *h, uint key1, uint key2, void *value);
|
||||
/**
|
||||
* Gets the value associated with the given key pair, or NULL when it is not
|
||||
* present. */
|
||||
* present.
|
||||
*/
|
||||
void *Hash_Get(const Hash *h, uint key1, uint key2);
|
||||
|
||||
/* Call these function to create/destroy a hash */
|
||||
|
||||
/**
|
||||
* Builds a new hash in an existing struct. Make sure that hash() always
|
||||
* returns a hash less than num_buckets! Call delete_hash after use */
|
||||
* returns a hash less than num_buckets! Call delete_hash after use
|
||||
*/
|
||||
void init_Hash(Hash *h, Hash_HashProc *hash, uint num_buckets);
|
||||
/**
|
||||
* Deletes the hash and cleans up. Only cleans up memory allocated by new_Hash
|
||||
|
@@ -181,7 +181,8 @@ bad:;
|
||||
/**
|
||||
* returns the track to choose on the next tile, or -1 when it's better to
|
||||
* reverse. The tile given is the tile we are about to enter, enterdir is the
|
||||
* direction in which we are entering the tile */
|
||||
* direction in which we are entering the tile
|
||||
*/
|
||||
Track OPFShipChooseTrack(const Ship *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks)
|
||||
{
|
||||
assert(IsValidDiagDirection(enterdir));
|
||||
|
@@ -19,7 +19,8 @@
|
||||
/**
|
||||
* Hash table based node list multi-container class.
|
||||
* Implements open list, closed list and priority queue for A-star
|
||||
* path finder. */
|
||||
* path finder.
|
||||
*/
|
||||
template <class Titem_, int Thash_bits_open_, int Thash_bits_closed_>
|
||||
class CNodeList_HashTableT {
|
||||
public:
|
||||
|
@@ -116,7 +116,8 @@ public:
|
||||
* - the destination was found
|
||||
* - or the open list is empty (no route to destination).
|
||||
* - or the maximum amount of loops reached - m_max_search_nodes (default = 10000)
|
||||
* @return true if the path was found */
|
||||
* @return true if the path was found
|
||||
*/
|
||||
inline bool FindPath(const VehicleType *v)
|
||||
{
|
||||
m_veh = v;
|
||||
@@ -223,7 +224,8 @@ public:
|
||||
|
||||
/**
|
||||
* AddNewNode() - called by Tderived::PfFollowNode() for each child node.
|
||||
* Nodes are evaluated here and added into open list */
|
||||
* Nodes are evaluated here and added into open list
|
||||
*/
|
||||
void AddNewNode(Node &n, const TrackFollower &tf)
|
||||
{
|
||||
/* evaluate the node */
|
||||
|
@@ -148,7 +148,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate
|
||||
*/
|
||||
inline bool PfCalcEstimate(Node& n)
|
||||
{
|
||||
static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
|
||||
@@ -179,7 +180,8 @@ public:
|
||||
* YAPF template that uses Ttypes template argument to determine all YAPF
|
||||
* components (base classes) from which the actual YAPF is composed.
|
||||
* For example classes consult: CYapfRail_TypesT template and its instantiations:
|
||||
* CYapfRail1, CYapfRail2, CYapfRail3, CYapfAnyDepotRail1, CYapfAnyDepotRail2, CYapfAnyDepotRail3 */
|
||||
* CYapfRail1, CYapfRail2, CYapfRail3, CYapfAnyDepotRail1, CYapfAnyDepotRail2, CYapfAnyDepotRail3
|
||||
*/
|
||||
template <class Ttypes>
|
||||
class CYapfT
|
||||
: public Ttypes::PfBase ///< Instance of CYapfBaseT - main YAPF loop and support base class
|
||||
|
@@ -28,7 +28,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to attach cached or local segment cost data to the given node.
|
||||
* @return true if globally cached data were used or false if local data was used */
|
||||
* @return true if globally cached data were used or false if local data was used
|
||||
*/
|
||||
FORCEINLINE bool PfNodeCacheFetch(Node& n)
|
||||
{
|
||||
return false;
|
||||
@@ -36,7 +37,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to flush the cached segment cost data back into cache storage.
|
||||
* Current cache implementation doesn't use that. */
|
||||
* Current cache implementation doesn't use that.
|
||||
*/
|
||||
FORCEINLINE void PfNodeCacheFlush(Node& n)
|
||||
{
|
||||
}
|
||||
@@ -71,7 +73,8 @@ protected:
|
||||
public:
|
||||
/**
|
||||
* Called by YAPF to attach cached or local segment cost data to the given node.
|
||||
* @return true if globally cached data were used or false if local data was used */
|
||||
* @return true if globally cached data were used or false if local data was used
|
||||
*/
|
||||
FORCEINLINE bool PfNodeCacheFetch(Node& n)
|
||||
{
|
||||
CacheKey key(n.GetKey());
|
||||
@@ -81,7 +84,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to flush the cached segment cost data back into cache storage.
|
||||
* Current cache implementation doesn't use that. */
|
||||
* Current cache implementation doesn't use that.
|
||||
*/
|
||||
FORCEINLINE void PfNodeCacheFlush(Node& n)
|
||||
{
|
||||
}
|
||||
@@ -93,7 +97,8 @@ public:
|
||||
* of track layout changes and static notification function called whenever
|
||||
* the track layout changes. It is implemented as base class because it needs
|
||||
* to be shared between all rail YAPF types (one shared counter, one notification
|
||||
* function. */
|
||||
* function.
|
||||
*/
|
||||
struct CSegmentCostCacheBase
|
||||
{
|
||||
static int s_rail_change_counter;
|
||||
@@ -113,7 +118,8 @@ struct CSegmentCostCacheBase
|
||||
* be always the same (TileIndex + DiagDirection) that represent the beginning
|
||||
* of the segment (origin tile and exit-dir from this tile).
|
||||
* Different CYapfCachedCostT types can share the same type of CSegmentCostCacheT.
|
||||
* Look at CYapfRailSegment (yapf_node_rail.hpp) for the segment example */
|
||||
* Look at CYapfRailSegment (yapf_node_rail.hpp) for the segment example
|
||||
*/
|
||||
template <class Tsegment>
|
||||
struct CSegmentCostCacheT
|
||||
: public CSegmentCostCacheBase
|
||||
@@ -203,7 +209,8 @@ protected:
|
||||
public:
|
||||
/**
|
||||
* Called by YAPF to attach cached or local segment cost data to the given node.
|
||||
* @return true if globally cached data were used or false if local data was used */
|
||||
* @return true if globally cached data were used or false if local data was used
|
||||
*/
|
||||
FORCEINLINE bool PfNodeCacheFetch(Node& n)
|
||||
{
|
||||
if (!Yapf().CanUseGlobalCache(n)) {
|
||||
@@ -218,7 +225,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to flush the cached segment cost data back into cache storage.
|
||||
* Current cache implementation doesn't use that. */
|
||||
* Current cache implementation doesn't use that.
|
||||
*/
|
||||
FORCEINLINE void PfNodeCacheFlush(Node& n)
|
||||
{
|
||||
}
|
||||
|
@@ -279,7 +279,8 @@ public:
|
||||
/**
|
||||
* Called by YAPF to calculate the cost from the origin to the given node.
|
||||
* Calculates only the cost of given node, adds it to the parent node cost
|
||||
* and stores the result into Node::m_cost member */
|
||||
* and stores the result into Node::m_cost member
|
||||
*/
|
||||
FORCEINLINE bool PfCalcCost(Node &n, const TrackFollower *tf)
|
||||
{
|
||||
assert(!n.flags_u.flags_s.m_targed_seen);
|
||||
|
@@ -65,7 +65,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate
|
||||
*/
|
||||
FORCEINLINE bool PfCalcEstimate(Node& n)
|
||||
{
|
||||
n.m_estimate = n.m_cost;
|
||||
@@ -105,7 +106,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate. */
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate.
|
||||
*/
|
||||
FORCEINLINE bool PfCalcEstimate(Node& n)
|
||||
{
|
||||
n.m_estimate = n.m_cost;
|
||||
@@ -185,7 +187,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate
|
||||
*/
|
||||
FORCEINLINE bool PfCalcEstimate(Node& n)
|
||||
{
|
||||
static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
|
||||
|
@@ -204,7 +204,8 @@ public:
|
||||
/**
|
||||
* Called by YAPF to move from the given node to the next tile. For each
|
||||
* reachable trackdir on the new tile creates new node, initializes it
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n) */
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n)
|
||||
*/
|
||||
inline void PfFollowNode(Node& old_node)
|
||||
{
|
||||
TrackFollower F(Yapf().GetVehicle());
|
||||
@@ -299,7 +300,8 @@ public:
|
||||
/**
|
||||
* Called by YAPF to move from the given node to the next tile. For each
|
||||
* reachable trackdir on the new tile creates new node, initializes it
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n) */
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n)
|
||||
*/
|
||||
inline void PfFollowNode(Node& old_node)
|
||||
{
|
||||
TrackFollower F(Yapf().GetVehicle(), Yapf().GetCompatibleRailTypes());
|
||||
@@ -381,7 +383,8 @@ public:
|
||||
/**
|
||||
* Called by YAPF to move from the given node to the next tile. For each
|
||||
* reachable trackdir on the new tile creates new node, initializes it
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n) */
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n)
|
||||
*/
|
||||
inline void PfFollowNode(Node& old_node)
|
||||
{
|
||||
TrackFollower F(Yapf().GetVehicle());
|
||||
|
@@ -98,7 +98,8 @@ public:
|
||||
/**
|
||||
* Called by YAPF to calculate the cost from the origin to the given node.
|
||||
* Calculates only the cost of given node, adds it to the parent node cost
|
||||
* and stores the result into Node::m_cost member */
|
||||
* and stores the result into Node::m_cost member
|
||||
*/
|
||||
FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf)
|
||||
{
|
||||
int segment_cost = 0;
|
||||
@@ -189,7 +190,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate
|
||||
*/
|
||||
FORCEINLINE bool PfCalcEstimate(Node& n)
|
||||
{
|
||||
n.m_estimate = n.m_cost;
|
||||
@@ -258,7 +260,8 @@ public:
|
||||
|
||||
/**
|
||||
* Called by YAPF to calculate cost estimate. Calculates distance to the destination
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate */
|
||||
* adds it to the actual cost from origin and stores the sum to the Node::m_estimate
|
||||
*/
|
||||
inline bool PfCalcEstimate(Node& n)
|
||||
{
|
||||
static const int dg_dir_to_x_offs[] = {-1, 0, 1, 0};
|
||||
@@ -308,7 +311,8 @@ public:
|
||||
/**
|
||||
* Called by YAPF to move from the given node to the next tile. For each
|
||||
* reachable trackdir on the new tile creates new node, initializes it
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n) */
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n)
|
||||
*/
|
||||
inline void PfFollowNode(Node& old_node)
|
||||
{
|
||||
TrackFollower F(Yapf().GetVehicle());
|
||||
|
@@ -35,7 +35,8 @@ public:
|
||||
/**
|
||||
* Called by YAPF to move from the given node to the next tile. For each
|
||||
* reachable trackdir on the new tile creates new node, initializes it
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n) */
|
||||
* and adds it to the open list by calling Yapf().AddNewNode(n)
|
||||
*/
|
||||
inline void PfFollowNode(Node& old_node)
|
||||
{
|
||||
TrackFollower F(Yapf().GetVehicle());
|
||||
@@ -119,7 +120,8 @@ public:
|
||||
/**
|
||||
* Called by YAPF to calculate the cost from the origin to the given node.
|
||||
* Calculates only the cost of given node, adds it to the parent node cost
|
||||
* and stores the result into Node::m_cost member */
|
||||
* and stores the result into Node::m_cost member
|
||||
*/
|
||||
FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf)
|
||||
{
|
||||
/* base tile cost depending on distance */
|
||||
|
Reference in New Issue
Block a user