71 proto native
int GetSlot();
77 proto native
int GetIdx();
83 proto native
int GetRow();
89 proto native
int GetCol();
95 proto native
bool GetFlip();
107 proto native
void GetDir(out
float dir[4]);
123 proto native
void SetGroundEx(
EntityAI e,
vector pos,
float dir[4]);
131 proto native
void SetAttachment(notnull
EntityAI parent,
EntityAI e,
int slotId);
141 proto native
void SetCargoAuto(notnull
CargoBase cargo,
EntityAI e,
int row,
int col,
bool flip);
152 proto native
void SetCargo(notnull
EntityAI parent,
EntityAI e,
int idx,
int row,
int col,
bool flip);
165 proto native
void SetProxyCargo(notnull
EntityAI parent,
EntityAI e,
int idx,
int row,
int col,
bool flip);
191 proto native
void SetParent(notnull
EntityAI parent);
196 proto native
void SetItem(notnull
EntityAI item);
199 proto native
void SetSlot(
int slotId);
200 proto native
void SetIndex(
int idx);
201 proto native
void SetRow(
int row);
202 proto native
void SetCol(
int col);
203 proto native
void SetFlip(
bool flip);
208 proto native
void Reset();
236 return loc.DumpToString();
255 res = res +
" pos=(" + pos[0] +
", " + pos[1] +
", " + pos[2] +
")";
256 res = res +
" dir=(" + dir[0] +
", " + dir[1] +
", " + dir[2] +
", " + dir[3] +
")";
263 res = res +
" slot=" + GetSlot();
270 res = res +
" idx=" + GetIdx() +
" row=" + GetRow() +
" col=" + GetCol() +
" f=" + GetFlip();
283 res = res +
" idx=" + GetIdx() +
" row=" + GetRow() +
" col=" + GetCol() +
" f=" + GetFlip();
290 res = res +
" idx=" + GetIdx();
344 Debug.Log(
string.Format(
"Item=%1 does not exist on server!",
Object.GetDebugName(item)),
"GROUND" ,
"n/a",
"ReadFromContext",
this.ToString() );
350 SetGroundEx(item, pos, dir);
355 if (!ctx.Read(parent))
363 if (!parent || !item)
367 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"ATTACHMENT" ,
"n/a",
"ReadFromContext",
this.ToString() );
373 SetAttachment(parent, item, slot);
378 if (!ctx.Read(parent))
391 if (!parent || !item)
395 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"CARGO" ,
"n/a",
"ReadFromContext",
this.ToString() );
401 SetCargo(parent, item, idx, row, col, flp);
406 if (!ctx.Read(parent))
411 if (!parent || !item)
415 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"HANDS" ,
"n/a",
"ReadFromContext",
this.ToString() );
421 SetHands(parent, item);
426 if (!ctx.Read(parent))
439 if (!parent || !item)
443 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"PROXYCARGO" ,
"n/a",
"ReadFromContext",
this.ToString() );
449 SetProxyCargo(parent, item, idx, row, col, flp);
454 if (!ctx.Read(parent))
461 if (!parent || !item)
465 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"VEHICLE" ,
"n/a",
"ReadFromContext",
this.ToString() );
471 SetVehicle(parent, item, idx);
477 if (!ctx.Read(parent))
486 if (!parent || !item)
490 Debug.Log(
string.Format(
"Parent=%1 or Item=%2 does not exist on server!",
Object.GetDebugName(parent),
Object.GetDebugName(item)),
"TEMP" ,
"n/a",
"ReadFromContext",
this.ToString() );
495 SetAttachment(parent, item, -1);
500 ErrorEx(
"ReadFromContext - really unknown location type, this should not happen, type=" + type);
512 if (!ctx.Write(type))
514 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed to write temp type");
518 else if (!ctx.Write(GetType()))
520 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed to write type");
532 if (!ctx.Write(GetItem()))
534 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed GND, arg=item");
541 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed GND, arg=pos");
549 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed GND, arg=dir");
557 if (!ctx.Write(GetParent()))
559 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed ATT, arg=parent");
562 if (!ctx.Write(GetItem()))
564 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed ATT, arg=item");
567 if (!ctx.Write(GetSlot()))
569 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed ATT, arg=slot");
576 if (!ctx.Write(GetParent()))
578 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=parent");
581 if (!ctx.Write(GetItem()))
583 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=item");
586 if (!ctx.Write(GetIdx()))
588 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=idx");
591 if (!ctx.Write(GetRow()))
593 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=row");
596 if (!ctx.Write(GetCol()))
598 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=col");
601 if (!ctx.Write(GetFlip()))
603 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=flp");
610 if (!ctx.Write(GetParent()))
612 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed HND, arg=parent");
615 if (!ctx.Write(GetItem()))
617 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed HND, arg=item");
624 if (!ctx.Write(GetParent()))
626 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=parent");
629 if (!ctx.Write(GetItem()))
631 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=item");
634 if (!ctx.Write(GetIdx()))
636 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=idx");
639 if (!ctx.Write(GetRow()))
641 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=row");
644 if (!ctx.Write(GetCol()))
646 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=col");
649 if (!ctx.Write(GetFlip()))
651 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=flp");
660 if (!ctx.Write(GetParent()))
662 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed VHC, arg=parent");
665 if (!ctx.Write(GetItem()))
667 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed VHC, arg=item");
670 if (!ctx.Write(GetIdx()))
672 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed VHC, arg=idx");
680 if (!ctx.Write(GetParent()))
682 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed TMP, arg=parent");
686 if (!ctx.Write(GetItem()))
688 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed TMP, arg=item");
694 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed TMP, idx=-1");
702 Error(
"WriteToContext - really unknown location type, this should not happen, type=" +
GetType());