public TennisGame1(IGameScore gameScore) { currentGameScore = gameScore; gamesWon = new Dictionary <string, int> { { gameScore.getPlayerOneName(), 0 }, { gameScore.getPlayerTwoName(), 0 } }; }
public void WonPoint(string playerName) { currentGameScore.winPoint(playerName); if (!currentGameScore.hasPlayerWon(playerName)) { return; } currentGameScore = new GameScore(currentGameScore.getPlayerOneName(), currentGameScore.getPlayerTwoName()); gamesWon[playerName] += 1; }
public GamePlayerViewModel() { context = new GameScoreRepository(); if (DesignerProperties.GetIsInDesignMode( new System.Windows.DependencyObject())) { return; } PlayerAuthentication.baseWebAddress = "http://localhost:50574/"; //ScoreList = new ObservableCollection<GameScoreObject>( PlayerAuthentication.getScores(4, "Battle Call")); ScoreList = new ObservableCollection <GameScoreObject>(context.getGameScores(4, "Battle Call")); }
private void CheckAllScores(IGameScore game) { var highestScore = Math.Max(player1Score, player2Score); for (var i = 0; i < highestScore; i++) { if (i < player1Score) { game.winPoint(player1Name); } if (i < player2Score) { game.winPoint(player2Name); } } Assert.AreEqual(expectedScore, game.getCurrentScore()); }
public CollisionSystem(IEntityManager entityManager, IMeteorFactory meteorFactory, IGameScore gameScore) { _entityManager = entityManager; _meteorFactory = meteorFactory; _gameScore = gameScore; }
public GameScoreManager() { scores = new GameScore(LoadHighScore()); scores.ScoreChanged += Scores_ScoreChanged; scores.HighScoreChanged += Scores_HighScoreChanged; }
private void _init(IGameStage gameStage, IGameScore gameScore) { _gameStage = gameStage; _gameScore = gameScore; }
private void _init(IGameScore gameScore) { _gameScore = gameScore; }
public GameStage(IGameScore gameScore, ISpawner spawner, IMainObjectsSource mainObjectsSource) { _gameScore = gameScore; _spawner = spawner; _mainObjectsSource = mainObjectsSource; }
public void Init(IGameConfig gameConfig) { Config = gameConfig; Score = new GameScore(Config.Teams.Count, Config.Rounds.Count); }