12 protected ref map<EntityID, IEntity>
m_aOccupiedStatic =
new map<EntityID, IEntity>();
30 static SCR_CompositionSlotManagerComponent
GetInstance()
33 return SCR_CompositionSlotManagerComponent.Cast(
GetGame().
GetGameMode().FindComponent(SCR_CompositionSlotManagerComponent));
43 if (Replication.IsClient())
46 RplId rplID = Replication.FindId(slot);
58 if (Replication.IsClient())
62 GetOwner().GetWorld().QueryEntitiesBySphere(pos, 1,
QueryEntity,
null, EQueryEntitiesFlags.STATIC);
75 RplId slotID = Replication.FindId(slot);
90 RplId slotID = Replication.FindId(slot);
142 if (Replication.IsServer() &&
ModifyArray(slotID, isOccupied, occupant))
147 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
158 if (Replication.IsServer() &&
ModifyArray(slotID, isOccupied, occupant))
163 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
196 protected bool ModifyArray(RplId slotID,
bool isOccupied, IEntity occupant)
201 UpdateSlot(IEntity.Cast(Replication.FindItem(slotID)), isOccupied);
209 UpdateSlot(IEntity.Cast(Replication.FindItem(slotID)), isOccupied);
230 entity.SetVisible(!isOccupied);
234 core.Event_OnEntityExtendedChange.Invoke(entity, isOccupied);
243 IEntity slot =
GetSlot(entity.GetOwner());
248 if (entity.IsRegistered())
251 entity.GetTransform(transform);
252 if (vector.Distance(transform[3], slot.GetWorldTransformAxis(3)) < 0.1)
284 writer.WriteInt(occupiedCount);
285 for (
int i = 0; i < occupiedCount; i++)
291 writer.WriteInt(occupiedCount);
292 for (
int i = 0; i < occupiedCount; i++)
304 reader.ReadInt(occupiedCount);
308 for (
int i = 0; i < occupiedCount; i++)
310 reader.ReadEntityId(entityID);
316 reader.ReadInt(occupiedCount);
318 for (
int i = 0; i < occupiedCount; i++)
320 reader.ReadRplId(rplID);
322 UpdateSlot(IEntity.Cast(Replication.FindItem(rplID)),
true);