DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл MapNavigationBehaviour.c

См. исходные тексты.

Перечисления

enum  EMapNavigationType { BASIC = 0 , COMPASS = 1 , GPS = 2 , ALL = 4 }
 

Функции

void MapNavigationBehaviour (PlayerBase pPlayer, EMapNavigationType pNavigationType=EMapNavigationType.BASIC)
 
void SetNavigationType (EMapNavigationType pType)
 
void UnsetNavigationType (EMapNavigationType pType)
 
EMapNavigationType GetNavigationType ()
 
void OnItemInPlayerPossession (EntityAI item)
 
void OnItemNotInPlayerPossession (EntityAI item)
 
void RandomizePosition ()
 
float RandomizedDeviation ()
 
vector GetPositionRandomized ()
 
vector GetPositionReal ()
 
static array< intOrderedPositionNumbersFromGridCoords (EntityAI pEntity)
 
static array< intOrderedAltitudeNumbersPosition (EntityAI pEntity)
 
static bool IsOutOfMap (EntityAI pEntity)
 

Переменные

enum EMapNavigationType RANDOM_DEVIATION_MIN = 4
 
const int RANDOM_DEVIATION_MAX = 15
 
static const int DISPLAY_GRID_POS_MAX_CHARS_COUNT = 3
 
static const int DISPLAY_ALT_MAX_CHARS_COUNT = 4
 
static const string GRID_SIZE_CFG_PATH = "CfgWorlds %1 Grid Zoom1 stepX"
 
int m_RandomPositionDeviationX
 
int m_RandomPositionDeviationZ
 
EMapNavigationType m_NavigationType
 
PlayerBase m_Player
 
ref array< EntityAIm_GPSInPossessionArr
 
ref array< EntityAIm_CompassInPossessionArr
 

Перечисления

◆ EMapNavigationType

Элементы перечислений
BASIC 
COMPASS 
GPS 
ALL 
2{
3 BASIC = 0,
4 COMPASS = 1,
5 GPS = 2,
6 ALL = 4
7}
@ BASIC
Definition MapNavigationBehaviour.c:3
@ GPS
Definition MapNavigationBehaviour.c:5
@ COMPASS
Definition MapNavigationBehaviour.c:4
@ ALL
Definition MapNavigationBehaviour.c:6

Функции

◆ GetNavigationType()

EMapNavigationType GetNavigationType ( )
protected
47 {
48 return m_NavigationType;
49 }
EMapNavigationType m_NavigationType
Definition MapNavigationBehaviour.c:21

Перекрестные ссылки m_NavigationType.

◆ GetPositionRandomized()

vector GetPositionRandomized ( )
protected
113 {
114 vector realPosition = m_Player.GetPosition();
116
117 return randomizedPosition;
118 }
int m_RandomPositionDeviationZ
Definition MapNavigationBehaviour.c:20
PlayerBase m_Player
Definition MapNavigationBehaviour.c:22
int m_RandomPositionDeviationX
Definition MapNavigationBehaviour.c:19
Definition EntityAI.c:95
Definition EnConvert.c:106
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

Перекрестные ссылки m_Player, m_RandomPositionDeviationX, m_RandomPositionDeviationZ и Vector().

◆ GetPositionReal()

vector GetPositionReal ( )
protected
121 {
122 return m_Player.GetPosition();
123 }

Перекрестные ссылки m_Player.

◆ IsOutOfMap()

static bool IsOutOfMap ( EntityAI pEntity)
staticprotected
181 {
182 vector worldPos = pEntity.GetPosition();
183
184 if (worldPos[0] < 0 || worldPos[0] > GetGame().GetWorld().GetWorldSize() || worldPos[2] < 0 || worldPos[2] > GetGame().GetWorld().GetWorldSize())
185 {
186 return true;
187 }
188
189 return false;
190 }
proto native CGame GetGame()

Перекрестные ссылки GetGame().

Используется в OrderedPositionNumbersFromGridCoords().

◆ MapNavigationBehaviour()

void MapNavigationBehaviour ( PlayerBase pPlayer,
EMapNavigationType pNavigationType = EMapNavigationType.BASIC )
protected
28 {
31
34 }
ref array< EntityAI > m_GPSInPossessionArr
Definition MapNavigationBehaviour.c:24
ref array< EntityAI > m_CompassInPossessionArr
Definition MapNavigationBehaviour.c:25

Перекрестные ссылки m_CompassInPossessionArr, m_GPSInPossessionArr, m_NavigationType и m_Player.

Используется в GPSReceiver::GPSReceiver(), ManBase::Init(), UIScriptedMenu::Update(), GPSReceiver::UpdateDisplayElevation() и GPSReceiver::UpdateDisplayPosition().

◆ OnItemInPlayerPossession()

void OnItemInPlayerPossession ( EntityAI item)
protected
52 {
53 if (item.IsInherited(ItemGPS))
54 {
56 {
59 }
60 }
61
62 if (item.IsInherited(ItemCompass))
63 {
65 {
68 }
69 }
70 }
void SetNavigationType(EMapNavigationType pType)
Definition MapNavigationBehaviour.c:36
EMapNavigationType
Definition MapNavigationBehaviour.c:2
const int INDEX_NOT_FOUND
Definition gameplay.c:13

Перекрестные ссылки INDEX_NOT_FOUND, m_CompassInPossessionArr, m_GPSInPossessionArr и SetNavigationType().

◆ OnItemNotInPlayerPossession()

void OnItemNotInPlayerPossession ( EntityAI item)
protected
73 {
74 if (item.IsInherited(ItemGPS))
75 {
76 m_GPSInPossessionArr.RemoveItem(item);
77 if (m_GPSInPossessionArr.Count() == 0)
78 {
80 }
81 }
82
83 if (item.IsInherited(ItemCompass))
84 {
86 if (m_CompassInPossessionArr.Count() == 0)
87 {
89 }
90 }
91 }
void UnsetNavigationType(EMapNavigationType pType)
Definition MapNavigationBehaviour.c:41

Перекрестные ссылки m_CompassInPossessionArr, m_GPSInPossessionArr и UnsetNavigationType().

◆ OrderedAltitudeNumbersPosition()

static array< int > OrderedAltitudeNumbersPosition ( EntityAI pEntity)
staticprotected
166 {
168 float altF = pEntity.GetPosition()[1];
169 int altI = Math.Round(altF);
170 string altString = altI.ToStringLen(DISPLAY_ALT_MAX_CHARS_COUNT);
171
172 for (int i = 0; i < altString.Length(); ++i)
173 {
174 altArray.Insert(altString.Get(i).ToInt());
175 }
176
177 return altArray;
178 }
static const int DISPLAY_ALT_MAX_CHARS_COUNT
Definition MapNavigationBehaviour.c:15
Definition EnMath.c:7
static proto float Round(float f)
Returns mathematical round of value.

Перекрестные ссылки DISPLAY_ALT_MAX_CHARS_COUNT и Math::Round().

◆ OrderedPositionNumbersFromGridCoords()

static array< int > OrderedPositionNumbersFromGridCoords ( EntityAI pEntity)
staticprotected
126 {
127 float gridSize = GetGame().ConfigGetFloat(string.Format(GRID_SIZE_CFG_PATH, GetGame().GetWorldName()));
128 int gridX, gridZ;
129 GetGame().GetWorld().GetGridCoords(pEntity.GetPosition(), gridSize, gridX, gridZ);
130
133
135 string gridXStr = gridX.ToStringLen(DISPLAY_GRID_POS_MAX_CHARS_COUNT);
136 string gridZStr = gridZ.ToStringLen(DISPLAY_GRID_POS_MAX_CHARS_COUNT);
137
138 int i = 0;
139 int gridCoordNumber;
140 for (i = 0; i < gridXStr.Length(); ++i)
141 {
142 gridCoordNumber = gridXStr.Get(i).ToInt();
143 if (IsOutOfMap(pEntity))
144 {
145 gridCoordNumber = -1;
146 }
147
149 }
150
151 for (i = 0; i < gridZStr.Length(); ++i)
152 {
153 gridCoordNumber = gridZStr.Get(i).ToInt();
154 if (IsOutOfMap(pEntity))
155 {
156 gridCoordNumber = -1;
157 }
158
160 }
161
162 return positions;
163 }
static const string GRID_SIZE_CFG_PATH
Definition MapNavigationBehaviour.c:17
static bool IsOutOfMap(EntityAI pEntity)
Definition MapNavigationBehaviour.c:180
static const int DISPLAY_GRID_POS_MAX_CHARS_COUNT
Definition MapNavigationBehaviour.c:14
static proto int AbsInt(int i)
Returns absolute value.

Перекрестные ссылки Math::AbsInt(), DISPLAY_GRID_POS_MAX_CHARS_COUNT, GetGame(), GRID_SIZE_CFG_PATH и IsOutOfMap().

◆ RandomizedDeviation()

float RandomizedDeviation ( )
protected
100 {
102 if ((Math.RandomIntInclusive(0, 10) % 2) == 0)
103 {
105 }
106 else
107 {
109 }
110 }
enum EMapNavigationType RANDOM_DEVIATION_MIN
const int RANDOM_DEVIATION_MAX
Definition MapNavigationBehaviour.c:12
static proto int Randomize(int seed)
Sets the seed for the random number generator.
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54
proto native float GetWorldTime()

Перекрестные ссылки GetWorldTime(), RANDOM_DEVIATION_MAX, RANDOM_DEVIATION_MIN, Math::RandomIntInclusive() и Math::Randomize().

Используется в RandomizePosition().

◆ RandomizePosition()

void RandomizePosition ( )
protected
94 {
97 }
float RandomizedDeviation()
Definition MapNavigationBehaviour.c:99

Перекрестные ссылки m_RandomPositionDeviationX, m_RandomPositionDeviationZ и RandomizedDeviation().

Используется в CrashBase::SpawnRandomDeers().

◆ SetNavigationType()

void SetNavigationType ( EMapNavigationType pType)
protected

Перекрестные ссылки m_NavigationType.

Используется в OnItemInPlayerPossession().

◆ UnsetNavigationType()

void UnsetNavigationType ( EMapNavigationType pType)
protected

Перекрестные ссылки m_NavigationType.

Используется в OnItemNotInPlayerPossession().

Переменные

◆ DISPLAY_ALT_MAX_CHARS_COUNT

const int DISPLAY_ALT_MAX_CHARS_COUNT = 4
static

Используется в OrderedAltitudeNumbersPosition().

◆ DISPLAY_GRID_POS_MAX_CHARS_COUNT

const int DISPLAY_GRID_POS_MAX_CHARS_COUNT = 3
static

Используется в OrderedPositionNumbersFromGridCoords().

◆ GRID_SIZE_CFG_PATH

const string GRID_SIZE_CFG_PATH = "CfgWorlds %1 Grid Zoom1 stepX"
staticprotected

Используется в OrderedPositionNumbersFromGridCoords().

◆ m_CompassInPossessionArr

ref array<EntityAI> m_CompassInPossessionArr
protected

◆ m_GPSInPossessionArr

ref array<EntityAI> m_GPSInPossessionArr
protected

◆ m_NavigationType

◆ m_Player

PlayerBase m_Player
protected

◆ m_RandomPositionDeviationX

int m_RandomPositionDeviationX
protected

Используется в GetPositionRandomized() и RandomizePosition().

◆ m_RandomPositionDeviationZ

int m_RandomPositionDeviationZ
protected

Используется в GetPositionRandomized() и RandomizePosition().

◆ RANDOM_DEVIATION_MAX

const int RANDOM_DEVIATION_MAX = 15

Используется в RandomizedDeviation().

◆ RANDOM_DEVIATION_MIN

enum EMapNavigationType RANDOM_DEVIATION_MIN = 4

Используется в RandomizedDeviation().