/// <summary> /// Initializes a new instance of the <see cref="FixedStepTimer"/> class. /// </summary> /// <param name="clock">The clock.</param> public FixedStepTimer(IGameClock clock) { Speed = 1.0; _clock = clock; StepSize = new TimeSpan(166666); StepSizeTolerance = new TimeSpan(2500); MaxNumberOfSteps = 8; AccumulateTimeSteps = true; _maxStepSize = new TimeSpan(StepSize.Ticks * MaxNumberOfSteps); }
public Game(IGameClock gameClock, IGameSettings settings) { _gameClock = gameClock; _settings = settings; PacMan = settings.PacMan; _collectedCoins = new List <CellLocation>(); _collectedPowerPills = new List <CellLocation>(); _ghosts = settings.Ghosts.ToDictionary(x => x.Name, x => x); _gameStateMachine = new GameStateMachine(this, settings, _gameNotifications); _gameState = new GameState(settings); }
public Game(IGameClock gameClock, IGameSettings settings) { _gameClock = gameClock; _settings = settings; _gameStateMachine = new GameStateMachine(settings, _gameNotifications, this); var gameState = new GameState(settings); _gameState = gameState; _gameStateMachineInstance = _gameStateMachine.CreateInstanceLift(gameState); Walls = _settings.Walls.Union(_settings.Doors).ToList().AsReadOnly(); _fruitForLevel = new[] { new Fruit(_settings.Fruit, FruitType.Cherry) }; }
public BlackjackApplication(IDealer dealer, IBlackjackConsole console, IGameClock clock) { this.dealer = dealer ?? throw new ArgumentNullException(nameof(dealer)); this.console = console ?? throw new ArgumentNullException(nameof(console)); this.clock = clock ?? throw new ArgumentNullException(nameof(clock)); playingPlayers = new List <Player>(); activePlayers = new List <Player>(); absentPlayers = new List <Player>(); bets = new Dictionary <Player, List <PlayerBet> >(); }
public Game(IGameClock gameClock, IGameSettings settings) { _gameClock = gameClock; _settings = settings; var actions = new Actions(settings, _gameNotifications); _gameStateMachine = new GameStateMachine(actions, settings, this); var gameState = new GameState(settings); _gameState = gameState; _gameStateMachineInstance = _gameStateMachine.CreateInstanceLift(gameState); WallsAndDoors = _settings.Walls.Union(_settings.Doors).ToList().AsReadOnly(); Walls = _settings.Walls; _fruitForLevel = new[] { new Fruit(_settings.Fruit, FruitType.Cherry) }; GhostHouseMiddle = CalculateMiddleOfGhostHouse(settings.GhostHouse); }
/// <summary> /// Initializes a new instance of the <see cref="VariableStepTimer"/> class. /// </summary> /// <param name="clock">The clock.</param> public VariableStepTimer(IGameClock clock) { Speed = 1.0; _clock = clock; }
//-------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="VariableStepTimer"/> class. /// </summary> /// <param name="clock">The clock.</param> public VariableStepTimer(IGameClock clock) { Speed = 1.0; _clock = clock; }
//-------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="FixedStepTimer"/> class. /// </summary> /// <param name="clock">The clock.</param> public FixedStepTimer(IGameClock clock) { Speed = 1.0; _clock = clock; StepSize = new TimeSpan(166666); StepSizeTolerance = new TimeSpan(2500); MaxNumberOfSteps = 8; AccumulateTimeSteps = true; _maxStepSize = new TimeSpan(StepSize.Ticks * MaxNumberOfSteps); }