35 proto native
bool IsValid();
42 proto native
int GetType();
70 proto native
int GetSlot();
76 proto native
int GetIdx();
82 proto native
int GetRow();
88 proto native
int GetCol();
94 proto native
bool GetFlip();
100 proto native
vector GetPos();
106 proto native
void GetDir(out
float dir[4]);
122 proto native
void SetGroundEx(
EntityAI e,
vector pos,
float dir[4]);
130 proto native
void SetAttachment(notnull
EntityAI parent,
EntityAI e,
int slotId);
140 proto native
void SetCargoAuto(notnull
CargoBase cargo,
EntityAI e,
int row,
int col,
bool flip);
151 proto native
void SetCargo(notnull
EntityAI parent,
EntityAI e,
int idx,
int row,
int col,
bool flip);
164 proto native
void SetProxyCargo(notnull
EntityAI parent,
EntityAI e,
int idx,
int row,
int col,
bool flip);
184 proto native
void SetParent(notnull
EntityAI parent);
189 proto native
void SetItem(notnull
EntityAI item);
192 proto native
void SetSlot(
int slotId);
193 proto native
void SetIndex(
int idx);
194 proto native
void SetRow(
int row);
195 proto native
void SetCol(
int col);
196 proto native
void SetFlip(
bool flip);
201 proto native
void Reset();
229 return loc.DumpToString();
233 string DumpToString()
248 res = res +
" pos=(" + pos[0] +
", " + pos[1] +
", " + pos[2] +
")";
249 res = res +
" dir=(" + dir[0] +
", " + dir[1] +
", " + dir[2] +
", " + dir[3] +
")";
255 res = res +
" parent=" +
Object.GetDebugName(GetParent());
256 res = res +
" slot=" + GetSlot();
262 res = res +
" parent=" +
Object.GetDebugName(GetParent());
263 res = res +
" idx=" + GetIdx() +
" row=" + GetRow() +
" col=" + GetCol() +
" f=" + GetFlip();
269 res = res +
" parent=" +
Object.GetDebugName(GetParent());
275 res = res +
" parent=" +
Object.GetDebugName(GetParent());
276 res = res +
" idx=" + GetIdx() +
" row=" + GetRow() +
" col=" + GetCol() +
" f=" + GetFlip();
282 res = res +
" parent=" +
Object.GetDebugName(GetParent());
283 res = res +
" idx=" + GetIdx();
330 Debug.Log(
string.Format(
"Item=%1 does not exist on server!",
Object.GetDebugName(item)),
"GROUND" ,
"n/a",
"ReadFromContext",
this.ToString() );
336 SetGroundEx(item, pos, dir);
341 if (!ctx.Read(parent))
349 if (!parent || !item)
353 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() );
359 SetAttachment(parent, item, slot);
364 if (!ctx.Read(parent))
377 if (!parent || !item)
381 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() );
387 SetCargo(parent, item, idx, row, col, flp);
392 if (!ctx.Read(parent))
397 if (!parent || !item)
401 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() );
407 SetHands(parent, item);
412 if (!ctx.Read(parent))
425 if (!parent || !item)
429 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() );
435 SetProxyCargo(parent, item, idx, row, col, flp);
440 if (!ctx.Read(parent))
447 if (!parent || !item)
451 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() );
457 SetVehicle(parent, item, idx);
462 ErrorEx(
"ReadFromContext - really unknown location type, this should not happen, type=" + type);
473 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed to write type");
487 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed GND, arg=item");
494 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed GND, arg=pos");
502 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed GND, arg=dir");
510 if (!ctx.Write(GetParent()))
512 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed ATT, arg=parent");
517 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed ATT, arg=item");
520 if (!ctx.Write(GetSlot()))
522 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed ATT, arg=slot");
529 if (!ctx.Write(GetParent()))
531 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=parent");
536 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=item");
539 if (!ctx.Write(GetIdx()))
541 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=idx");
544 if (!ctx.Write(GetRow()))
546 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=row");
549 if (!ctx.Write(GetCol()))
551 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=col");
554 if (!ctx.Write(GetFlip()))
556 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed CGO, arg=flp");
563 if (!ctx.Write(GetParent()))
565 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed HND, arg=parent");
570 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed HND, arg=item");
577 if (!ctx.Write(GetParent()))
579 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=parent");
584 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=item");
587 if (!ctx.Write(GetIdx()))
589 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=idx");
592 if (!ctx.Write(GetRow()))
594 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=row");
597 if (!ctx.Write(GetCol()))
599 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=col");
602 if (!ctx.Write(GetFlip()))
604 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed PXY, arg=flp");
613 if (!ctx.Write(GetParent()))
615 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed VHC, arg=parent");
620 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed VHC, arg=item");
623 if (!ctx.Write(GetIdx()))
625 Error(
"InventoryLocation::WriteToContext - cannot write to context! failed VHC, arg=idx");
632 Error(
"WriteToContext - really unknown location type, this should not happen, type=" +
GetType());