OpenClonk
SumPathLength Struct Reference

Public Member Functions

 SumPathLength (PathInfo *info)
 
bool operator() (int32_t iX, int32_t iY, C4Object *TransferTarget)
 

Detailed Description

Definition at line 2444 of file C4GameScript.cpp.

Constructor & Destructor Documentation

◆ SumPathLength()

SumPathLength::SumPathLength ( PathInfo info)
inlineexplicit

Definition at line 2446 of file C4GameScript.cpp.

2446 : pPathInfo(info) {}

Member Function Documentation

◆ operator()()

bool SumPathLength::operator() ( int32_t  iX,
int32_t  iY,
C4Object TransferTarget 
)
inline

Definition at line 2447 of file C4GameScript.cpp.

2448  {
2449  pPathInfo->ilen += Distance(pPathInfo->ilx, pPathInfo->ily, iX, iY);
2450  pPathInfo->ilx = iX;
2451  pPathInfo->ily = iY;
2452  return true;
2453  }
int32_t Distance(int32_t iX1, int32_t iY1, int32_t iX2, int32_t iY2)
Definition: Standard.cpp:25

References Distance(), PathInfo::ilen, PathInfo::ilx, and PathInfo::ily.

Here is the call graph for this function:

The documentation for this struct was generated from the following file: