DayZ 1.24
Loading...
Searching...
No Matches
InventoryLocation.c File Reference

Go to the source code of this file.

Classes

class  InventoryLocation
 InventoryLocation. More...
 

Enumerations

enum  InventoryLocationType {
  UNKNOWN , GROUND , ATTACHMENT , CARGO ,
  HANDS , PROXYCARGO
}
 types of Inventory Location More...
 
enum  FindInventoryLocationType {
  ATTACHMENT , CARGO , HANDS , PROXYCARGO ,
  ANY_CARGO , ANY , NO_SLOT_AUTO_ASSIGN
}
 flags for searching locations in inventory More...
 

Functions

bool OptionalLocationWriteToContext (InventoryLocation loc, notnull ParamsWriteContext ctx)
 
bool OptionalLocationReadFromContext (out InventoryLocation loc, notnull ParamsReadContext ctx)
 

Enumeration Type Documentation

◆ FindInventoryLocationType

flags for searching locations in inventory

Enumerator
ATTACHMENT 

< ground

ATT.

attachment of another entity

CARGO 

cargo of another entity

CGO.

HANDS 

hands of another entity

HND.

PROXYCARGO 

cargo of a large object (building,...)

PXY.

ANY_CARGO 

CGO | PXY.

ANY 

ATT | CGO | PXY | HND.

NO_SLOT_AUTO_ASSIGN 

skips auto-assign test

Definition at line 15 of file InventoryLocation.c.

16{
18 CARGO,
19 HANDS,
21 ANY_CARGO,
22 ANY,
24};
@ PROXYCARGO
cargo of a large object (building,...)
@ ANY
ATT | CGO | PXY | HND.
@ ANY_CARGO
CGO | PXY.
@ HANDS
hands of another entity
@ CARGO
cargo of another entity
@ NO_SLOT_AUTO_ASSIGN
skips auto-assign test
@ ATTACHMENT
< ground

◆ InventoryLocationType

types of Inventory Location

Enumerator
UNKNOWN 

unknown, usually freshly created object

GROUND 
ATTACHMENT 

< ground

ATT.

attachment of another entity

CARGO 

cargo of another entity

CGO.

HANDS 

hands of another entity

HND.

PROXYCARGO 

cargo of a large object (building,...)

PXY.

Definition at line 3 of file InventoryLocation.c.

4{
5 UNKNOWN,
6 GROUND,
8 CARGO,
9 HANDS,
11};
@ UNKNOWN
unknown, usually freshly created object
@ GROUND

Function Documentation

◆ OptionalLocationReadFromContext()

bool OptionalLocationReadFromContext ( out InventoryLocation loc,
notnull ParamsReadContext ctx )

Definition at line 605 of file InventoryLocation.c.

606{
607 bool present = false;
608 if (!ctx.Read(present))
609 {
610 Error("OptionalLocationReadFromContext - cannot read bool from context!");
611 return false;
612 }
613
614 if (!present)
615 return true;
616
617 loc = new InventoryLocation();
618 if (!loc.ReadFromContext(ctx))
619 {
620 Error("OptionalLocationReadFromContext - cannot read (present) inventorylocation from context!");
621 return false;
622 }
623 return true;
624}
InventoryLocation.
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error().

Referenced by CreateHandEventFromContext(), WeaponStateBase::LoadCurrentFSMState(), LoadCurrentFSMState(), and HandEventRemove::ReadFromContext().

◆ OptionalLocationWriteToContext()

bool OptionalLocationWriteToContext ( InventoryLocation loc,
notnull ParamsWriteContext ctx )

Definition at line 583 of file InventoryLocation.c.

584{
585 if (loc)
586 {
587 if (!ctx.Write(true))
588 {
589 Error("OptionalLocationWriteToContext - cannot write 1 to context!");
590 return false;
591 }
592 return loc.WriteToContext(ctx);
593 }
594 else
595 {
596 if (!ctx.Write(false))
597 {
598 Error("OptionalLocationWriteToContext - cannot write 0 to context!");
599 return false;
600 }
601 }
602 return true;
603}

References Error().

Referenced by WeaponStateBase::SaveCurrentFSMState(), SaveCurrentFSMState(), WriteToContext(), and HandEventRemove::WriteToContext().