/// <inheritdoc />
 public PlayerEntityCreationContext([NotNull] NetworkEntityGuid entityGuid,
                                    [NotNull] PlayerEntitySessionContext sessionContext,
                                    [NotNull] IMovementData movementData,
                                    EntityPrefab prefabType,
                                    [NotNull] IEntityDataFieldContainer entityData)
 {
     if (!Enum.IsDefined(typeof(EntityPrefab), prefabType))
     {
         throw new InvalidEnumArgumentException(nameof(prefabType), (int)prefabType, typeof(EntityPrefab));
     }
     EntityGuid     = entityGuid ?? throw new ArgumentNullException(nameof(entityGuid));
     SessionContext = sessionContext ?? throw new ArgumentNullException(nameof(sessionContext));
     MovementData   = movementData ?? throw new ArgumentNullException(nameof(movementData));
     PrefabType     = prefabType;
     EntityData     = entityData ?? throw new ArgumentNullException(nameof(entityData));
 }
Exemple #2
0
 /// <inheritdoc />
 public PlayerEntityEnterWorldCreationContext([NotNull] PlayerEntitySessionContext sessionContext, Vector3 spawnPosition)
 {
     SessionContext = sessionContext ?? throw new ArgumentNullException(nameof(sessionContext));
     SpawnPosition  = spawnPosition;
 }
 /// <inheritdoc />
 public PlayerSessionClaimedEventArgs([NotNull] NetworkEntityGuid entityGuid, Vector3 spawnPosition, [NotNull] PlayerEntitySessionContext sessionContext)
 {
     EntityGuid     = entityGuid ?? throw new ArgumentNullException(nameof(entityGuid));
     SpawnPosition  = spawnPosition;
     SessionContext = sessionContext ?? throw new ArgumentNullException(nameof(sessionContext));
 }