#pragma warning restore IDE0032 // Use auto property private Player( PlayerState state, ILocationStore locationStore, IRoadStore roadStore, Action <string> updateMessagingGroup) { _locationStore = locationStore; _roadStore = roadStore; _updateMessagingGroup = updateMessagingGroup; _playerId = state.PlayerId; _locationId = state.LocationId; if (state.RoadMovementState != null) { var road = roadStore.Find(state.RoadMovementState.RoadId); if (road == null) { throw new InvalidOperationException($"Road {state.RoadMovementState.RoadId} is not found in the store."); } _roadMovementComponent = new RoadMovementComponent(road, state.RoadMovementState.Progress, state.RoadMovementState.MovementDirection); } UpdateMessagingGroup(); }
public PlayerPersistenceFactory( ILocationStore locationStore, IRoadStore roadStore, IConnectedClientStore connectedClientStore) { _locationStore = locationStore; _roadStore = roadStore; _connectedClientStore = connectedClientStore; }
public static Player FromState( PlayerState state, ILocationStore locationStore, IRoadStore roadStore, Action <string> updateMessagingGroup) { return(new Player( state, locationStore, roadStore, updateMessagingGroup)); }