/// <inheritdoc /> public BlockOtherClientAlertedExistenceEventHandler([NotNull] IUnitScalerStrategy unitScaler, [NotNull] ILog logger, [NotNull] IEntityGuidMappable <WorldTransform> worldTransformMappable, [NotNull] IEntityGuidMappable <PlayerZoneData> zoneDataMappable) : base(logger) { UnitScaler = unitScaler ?? throw new ArgumentNullException(nameof(unitScaler)); WorldTransformMappable = worldTransformMappable ?? throw new ArgumentNullException(nameof(worldTransformMappable)); ZoneDataMappable = zoneDataMappable ?? throw new ArgumentNullException(nameof(zoneDataMappable)); }
public int TestGameSceneIndex = 7; //TODO: We're just hardcoding Pioneer2 scene /// <inheritdoc /> public BlockGameJoinEventPayloadHandler([NotNull] ILog logger, [NotNull] IUnitScalerStrategy unitScaler, [NotNull] ICharacterSlotSelectedModel slotModel, [NotNull] INetworkClientExportable exportableClient) : base(logger) { UnitScaler = unitScaler ?? throw new ArgumentNullException(nameof(unitScaler)); SlotModel = slotModel ?? throw new ArgumentNullException(nameof(slotModel)); ExportableClient = exportableClient ?? throw new ArgumentNullException(nameof(exportableClient)); }
/// <inheritdoc /> public BaseDefaultPositionChangedEventHandler([NotNull] IUnitScalerStrategy scaler, ILog logger, IEntityGuidMappable <WorldTransform> worldTransformMappable, [NotNull] IEntityGuidMappable <MovementManager> movementManagerMappable) : base(logger) { Scaler = scaler ?? throw new ArgumentNullException(nameof(scaler)); WorldTransformMappable = worldTransformMappable; MovementManagerMappable = movementManagerMappable ?? throw new ArgumentNullException(nameof(movementManagerMappable)); }
/// <summary> /// Scales the <see cref="Vector3"/> by the scaling with the option to ignore some dimensions flags. /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <param name="ignoreFlags">Which dimensions to ignore.</param> /// <returns>A new scaled vector.</returns> public static Vector3 Scale(this IUnitScalerStrategy scaler, Vector3 vector, UnitScaleFlags ignoreFlags) { float x = ignoreFlags.QuickFlagsCheck(UnitScaleFlags.X) ? vector.x : scaler.ScaleX(vector.x); float y = ignoreFlags.QuickFlagsCheck(UnitScaleFlags.Y) ? vector.y : scaler.ScaleY(vector.y);; float z = ignoreFlags.QuickFlagsCheck(UnitScaleFlags.Z) ? vector.z : scaler.ScaleZ(vector.z);; return(new Vector3(x, y, z)); }
/// <summary> /// Unscales the <see cref="Vector3"/> by the unscaling with the option to ignore some dimensions flags. /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <param name="ignoreFlags">Which dimensions to ignore.</param> /// <returns>A new scaled vector.</returns> public static Vector3 <float> UnScale(this IUnitScalerStrategy scaler, Vector3 <float> vector, UnitScaleFlags ignoreFlags) { float x = ignoreFlags.QuickFlagsCheck(UnitScaleFlags.X) ? vector.X : scaler.UnScaleX(vector.X); float y = ignoreFlags.QuickFlagsCheck(UnitScaleFlags.Y) ? vector.Y : scaler.UnScaleY(vector.Y);; float z = ignoreFlags.QuickFlagsCheck(UnitScaleFlags.Z) ? vector.Z : scaler.UnScaleZ(vector.Z);; return(new Vector3 <float>(x, y, z)); }
public DynamicMapSceneBuilder(IUnitScalerStrategy scaler) { if (scaler == null) { throw new ArgumentNullException(nameof(scaler)); } Scaler = scaler; }
public BlockOtherClientFinishedWarpingEventPayloadHandler([NotNull] IUnitScalerStrategy scalingService, IZoneSettings zoneSettings, ILog logger, [NotNull] ILocalPlayerData localPlayerData, [NotNull] IReadonlyEntityGuidMappable <PlayerZoneData> playerZoneDataMappable) : base(logger) { ScalingService = scalingService ?? throw new ArgumentNullException(nameof(scalingService)); LocalPlayerData = localPlayerData ?? throw new ArgumentNullException(nameof(localPlayerData)); PlayerZoneDataMappable = playerZoneDataMappable ?? throw new ArgumentNullException(nameof(playerZoneDataMappable)); //We just need the zone id. ZoneId = zoneSettings.ZoneId; }
/// <summary> /// Scales the <see cref="Vector3"/> by the scaling. /// Will use the vector2's Y component as the Vector3's Z component. /// Will use the Y component of the original vector. /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <returns>A new scaled vector.</returns> public static Vector3 ScaleYtoZ(this IUnitScalerStrategy scaler, Vector3 vector) { return(new Vector3(scaler.ScaleX(vector.x), vector.y, scaler.ScaleZ(vector.z))); }
/// <summary> /// Fully scales the <see cref="Vector2"/> by the scaling. /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <returns>A new scaled vector.</returns> public static Vector2 Scale(this IUnitScalerStrategy scaler, Vector2 <float> vector) { return(new Vector2(scaler.ScaleX(vector.X), scaler.ScaleY(vector.Y))); }
/// <summary> /// Fully scales the <see cref="Vector2"/> by the scaling. /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <returns>A new scaled vector.</returns> public static Vector2 ScaleYasZ(this IUnitScalerStrategy scaler, Vector2 vector) { return(new Vector3(scaler.ScaleX(vector.x), scaler.ScaleZ(vector.y))); }
/// <summary> /// Unscales the Y rotation based on the unit scale. /// </summary> /// <param name="scaler">The scaler.</param> /// <param name="rotation">The rotation to scale.</param> /// <returns></returns> public static float UnScaleYRotation(this IUnitScalerStrategy scaler, float rotation) { //TODO: IS this right? //This is odd but if we have both Z and X flipped then the Y will be the same. return((Math.Sign(scaler.ScaleZ(1)) + Math.Sign(scaler.ScaleX(1))) <= 0.0f ? -rotation : rotation); }
/// <summary> /// Unsclaes the <see cref="Vector3"/> by the scaling. /// Maps the Z component of the <see cref="Vector3"/> to the Y component of the /// <see cref="Vector2{T}"/>. /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <returns>A new scaled vector.</returns> public static Vector2 <float> UnScaleYtoZ(this IUnitScalerStrategy scaler, Vector3 vector) { return(new Vector2 <float>(scaler.UnScaleX(vector.x), scaler.UnScaleZ(vector.z))); }
/// <inheritdoc /> public BlockTeleportToPositionCommandHandler(ILog logger, [NotNull] IUnitScalerStrategy scalerService, [NotNull] IEntityGuidMappable <WorldTransform> entityLocationMappable) : base(logger) { ScalerService = scalerService ?? throw new ArgumentNullException(nameof(scalerService)); EntityLocationMappable = entityLocationMappable ?? throw new ArgumentNullException(nameof(entityLocationMappable)); }
/// <inheritdoc /> public AreaTeleportOnLocalPlayerSpawnedEventListener(ILocalPlayerWorldRepresentationSpawnedEventSubscribable subscriptionService, [NotNull] IPeerPayloadSendService <PSOBBGamePacketPayloadClient> sendService, [NotNull] IUnitScalerStrategy scalerService, [NotNull] IZoneSettings zoneSettings) : base(subscriptionService) { SendService = sendService ?? throw new ArgumentNullException(nameof(sendService)); ScalerService = scalerService ?? throw new ArgumentNullException(nameof(scalerService)); ZoneSettings = zoneSettings ?? throw new ArgumentNullException(nameof(zoneSettings)); }
/// <summary> /// Fully unscales the <see cref="Vector3"/> using the scaling service /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <returns>A new scaled vector.</returns> public static Vector3 <float> UnScale(this IUnitScalerStrategy scaler, Vector3 <float> vector) { return(new Vector3 <float>(scaler.UnScaleX(vector.X), scaler.UnScaleY(vector.Y), scaler.UnScaleZ(vector.Z))); }
/// <summary> /// Scales the <see cref="Vector3"/> by the scaling. /// Will use the vector2's Y component as the Vector3's Z component. /// Will use the Y component of the original vector. /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <returns>A new scaled vector.</returns> public static Vector3 <float> ScaleYtoZ(this IUnitScalerStrategy scaler, Vector3 <float> vector) { return(new Vector3 <float>(scaler.ScaleX(vector.X), vector.Y, scaler.ScaleZ(vector.Z))); }
/// <inheritdoc /> public PlayerInventoryDropItemEventHandler([NotNull] INetworkEntityFactory <INetworkItem> worldItemFactory, [NotNull] IUnitScalerStrategy unitScaler, [NotNull] ILog logger) : base(logger) { WorldItemFactory = worldItemFactory ?? throw new ArgumentNullException(nameof(worldItemFactory)); UnitScaler = unitScaler ?? throw new ArgumentNullException(nameof(unitScaler)); }
/// <inheritdoc /> public SoccerLobbyBallMovedEventHandler([NotNull] IUnitScalerStrategy unitScaler, ILog logger) : base(logger) { UnitScaler = unitScaler ?? throw new ArgumentNullException(nameof(unitScaler)); }
/// <inheritdoc /> public GameBurstingCompletedEventCommandHandler(ILog logger, [NotNull] ICharacterSlotSelectedModel slotModel, [NotNull] ILocalPlayerData playerData, [NotNull] IUnitScalerStrategy scalerService, [NotNull] IZoneSettings zoneSettings, [NotNull] IBurstingService burstingService) : base(logger) { SlotModel = slotModel ?? throw new ArgumentNullException(nameof(slotModel)); PlayerData = playerData ?? throw new ArgumentNullException(nameof(playerData)); ScalerService = scalerService ?? throw new ArgumentNullException(nameof(scalerService)); ZoneSettings = zoneSettings ?? throw new ArgumentNullException(nameof(zoneSettings)); BurstingService = burstingService ?? throw new ArgumentNullException(nameof(burstingService)); }
/// <inheritdoc /> public DefaultLocalPlayerNetworkMovementController([NotNull] IPeerPayloadSendService <PSOBBGamePacketPayloadClient> sendService, [NotNull] IUnitScalerStrategy unitScaler, [NotNull] IZoneSettings zoneData, [NotNull] IRoomQueryable roomQueryService, [NotNull] ICharacterSlotSelectedModel playerSlotModel) { SendService = sendService ?? throw new ArgumentNullException(nameof(sendService)); UnitScaler = unitScaler ?? throw new ArgumentNullException(nameof(unitScaler)); ZoneData = zoneData ?? throw new ArgumentNullException(nameof(zoneData)); RoomQueryService = roomQueryService ?? throw new ArgumentNullException(nameof(roomQueryService)); PlayerSlotModel = playerSlotModel ?? throw new ArgumentNullException(nameof(playerSlotModel)); }
/// <inheritdoc /> public FastMoveCommandHandler(IUnitScalerStrategy scaler, ILog logger, IEntityGuidMappable <WorldTransform> worldTransformMappable, IEntityGuidMappable <MovementManager> movementManagerMappable) : base(scaler, logger, worldTransformMappable, movementManagerMappable) { }
/// <summary> /// Fully unscales the <see cref="Vector3"/> using the scaling service /// </summary> /// <param name="scaler">The scaling service.</param> /// <param name="vector">The vector to scale.</param> /// <returns>A new scaled vector.</returns> public static Vector3 UnScale(this IUnitScalerStrategy scaler, Vector3 vector) { return(new Vector3(scaler.UnScaleX(vector.x), scaler.UnScaleY(vector.y), scaler.UnScaleZ(vector.z))); }