public InitNpcSegment( [NotNull] INpcComponent npc, [NotNull] IEntity observerEntity, bool needsUpdate) { if (npc == null) { throw new ArgumentNullException(nameof(npc)); } if (observerEntity == null) { throw new ArgumentNullException(nameof(observerEntity)); } var observerTransform = observerEntity.GetTransform(); var npcTransform = npc.Parent.GetTransform(); _yDelta = npcTransform.Y - observerTransform.Y; _xDelta = npcTransform.X - observerTransform.X; _npcInstanceId = npc.InstanceId; _needsUpdate = needsUpdate; _definitionId = npc.DefinitionId; }
public NpcInteractingEntity([NotNull] INpcComponent npc) { Entity = npc.Parent.Handle ?? throw new ArgumentNullException(nameof(npc)); Id = npc.InstanceId; }