DayZ 1.24
Loading...
Searching...
No Matches
VicinityObjects Class Reference

objects in vicinity - extended with secondary object which is parent of that Object More...

Private Member Functions

void VicinityObjects ()
 
void StoreVicinityObject (Object object, Object parent=null)
 stores VicinityObject to Hashmap - for storing of parent/child relationship
 
void TransformToVicinityObjects (array< Object > objects)
 transform simple array of Objects to VicinityObjects hashmap
 
void ClearVicinityObjects ()
 
array< ObjectGetVicinityObjects ()
 return simple array of Objects in Vicinity
 
array< ObjectGetRawVicinityObjects ()
 return simple array of Objects in Vicinity
 
Object GetObject (int i)
 returns VicinityObjects Key
 
Object GetParent (int i)
 returns VicinityObjects Element
 
int Count ()
 
void Remove (Object object)
 
void Remove (array< Object > objects)
 

Private Attributes

ref map< Object, Objectm_VicinityObjects
 

Detailed Description

objects in vicinity - extended with secondary object which is parent of that Object

Definition at line 2 of file ActionTargets.c.

Constructor & Destructor Documentation

◆ VicinityObjects()

void VicinityObjects::VicinityObjects ( )
inlineprivate

Definition at line 6 of file ActionTargets.c.

7 {
9 }
ref map< Object, Object > m_VicinityObjects

References m_VicinityObjects.

Member Function Documentation

◆ ClearVicinityObjects()

void VicinityObjects::ClearVicinityObjects ( )
inlineprivate

Definition at line 46 of file ActionTargets.c.

47 {
48 m_VicinityObjects.Clear();
49 }

References m_VicinityObjects.

◆ Count()

int VicinityObjects::Count ( )
inlineprivate

Definition at line 90 of file ActionTargets.c.

91 {
92 return m_VicinityObjects.Count();
93 }

References m_VicinityObjects.

◆ GetObject()

Object VicinityObjects::GetObject ( int i)
inlineprivate

returns VicinityObjects Key

Definition at line 79 of file ActionTargets.c.

80 {
81 return m_VicinityObjects.GetKey(i);
82 }

References m_VicinityObjects.

◆ GetParent()

Object VicinityObjects::GetParent ( int i)
inlineprivate

returns VicinityObjects Element

Definition at line 85 of file ActionTargets.c.

86 {
87 return m_VicinityObjects.GetElement(i);
88 }

References m_VicinityObjects.

◆ GetRawVicinityObjects()

array< Object > VicinityObjects::GetRawVicinityObjects ( )
inlineprivate

return simple array of Objects in Vicinity

Definition at line 69 of file ActionTargets.c.

70 {
72 for (int i = 0; i < m_VicinityObjects.Count(); i++)
74
75 return vicinityObjects;
76 }
Object GetObject()

References GetObject(), and m_VicinityObjects.

◆ GetVicinityObjects()

array< Object > VicinityObjects::GetVicinityObjects ( )
inlineprivate

return simple array of Objects in Vicinity

filters out non-takeable items (won't be shown in vicinity)

Definition at line 52 of file ActionTargets.c.

53 {
55 for (int i = 0; i < m_VicinityObjects.Count(); i++)
56 {
59 if (ib && !ib.IsTakeable())
60 continue;
61
63 }
64
65 return vicinityObjects;
66 }

References GetObject(), and m_VicinityObjects.

◆ Remove() [1/2]

void VicinityObjects::Remove ( array< Object > objects)
inlineprivate

Definition at line 100 of file ActionTargets.c.

101 {
102 for (int i = 0; i < objects.Count(); i++)
103 m_VicinityObjects.Remove(objects[i]);
104 }

References m_VicinityObjects.

◆ Remove() [2/2]

void VicinityObjects::Remove ( Object object)
inlineprivate

Definition at line 95 of file ActionTargets.c.

96 {
97 m_VicinityObjects.Remove(object);
98 }

References m_VicinityObjects.

◆ StoreVicinityObject()

void VicinityObjects::StoreVicinityObject ( Object object,
Object parent = null )
inlineprivate

stores VicinityObject to Hashmap - for storing of parent/child relationship

completely remove items that are being placed or are holograms

ignores plain objects

init of VicinityObjects - object, parent(if exists)

Definition at line 12 of file ActionTargets.c.

13 {
15 ItemBase ib = ItemBase.Cast(object);
16 if (ib && (ib.IsBeingPlaced() || ib.IsHologram()))
17 return;
18
20 /*if(object && object.IsPlainObject())
21 {
22 Print("ERROR: VicinityObjects | StoreVicinityObject | IsPlainObject check fail");
23 return;
24 }*/
25
26 if (!m_VicinityObjects.Contains(object))
27 {
29 m_VicinityObjects.Set(object, parent);
30 }
31 }

References m_VicinityObjects.

Referenced by TransformToVicinityObjects().

◆ TransformToVicinityObjects()

void VicinityObjects::TransformToVicinityObjects ( array< Object > objects)
inlineprivate

transform simple array of Objects to VicinityObjects hashmap

Definition at line 34 of file ActionTargets.c.

35 {
36 for (int i = 0; i < objects.Count(); i++)
37 {
38 if (objects[i].GetType() != "" && objects[i].CanBeActionTarget())
39 {
41 //Print("storing, 2nd pass: " + objects[i]);
42 }
43 }
44 }
eBleedingSourceType GetType()
override bool CanBeActionTarget()
Definition WoodBase.c:193
void StoreVicinityObject(Object object, Object parent=null)
stores VicinityObject to Hashmap - for storing of parent/child relationship

References CanBeActionTarget(), GetType(), and StoreVicinityObject().

Member Data Documentation

◆ m_VicinityObjects


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