private void Restart() { field = null; playerCircle = null; playerCross = null; playerCurrentTurn = null; result = null; playerSelected = false; }
public SpawnSys( int floor, ISpawnConfig spawnConfig, IGameResult <EntityList> previousFloorResult ) { FloorFactor = spawnConfig.FloorFactor(floor); SpawnConfig = spawnConfig; PreviousFloorResult = previousFloorResult; }
private static ShotDetails CreateShotHistory(IShot shot, IGameResult breakResult) { return(new ShotDetails { ShotResult = breakResult.Result, LastPlayedBall = shot.FirstTouchedBall, Player = shot.Player, Shot = shot }); }
private GameEngine <EntityList> GetFloorDown(IGameResult <EntityList> result) { StopCurrentFloorEngine(); if (CurrentFloor < FloorEngines.Count) { return(GetRestartFloorEngine(1, result)); } return(CreateGameStage(result)); }
public void RenderResult(IGameResult gameResult) { if (gameResult.IsDraw) { Console.WriteLine("Game was a draw"); Console.WriteLine(""); return; } Console.WriteLine("Game won by {0}", gameResult.Winner.Name); Console.WriteLine(""); }
public virtual void EndGame(IGameResult <EntityList> gameResult, bool pauseBeforeQuit = false) { Result = gameResult; if (pauseBeforeQuit) { Pause = true; } else { Quit = true; } }
private GameEngine <EntityList> GetRestartFloorEngine(int floorMovement, IGameResult <EntityList> result) { var currentFloorEngine = CurrentFloorEngine; CurrentFloor += floorMovement; var nextFloorEngine = CurrentFloorEngine; nextFloorEngine.Game.Restart(result); nextFloorEngine.SetInputControls(currentFloorEngine.InputHandler); return(nextFloorEngine); }
public async Task EndGame(GameInstance instance, IGameResult result) { instance.Result = result; Data.RemoveActiveGame(instance); await GameBroadcast(instance, Messages.GameOver()); foreach (var c in instance.Connections) { c.Game = null; } }
private void EndGame( IGameResult <EntityList> gameresult, StairsComp stairsComp, bool pauseBeforeQuit = false ) { // reset for next floor execution HasExitedStairs = false; PlayerPositionComp.Position = stairsComp.Position.Add(BoardComp.TILE_SIZE / 2); gameresult.Data.Clear(); gameresult.Data.Add(PlayerEntity.Id, PlayerEntity); Game.GameEvents.Add(stairsComp.GetGameEvent()); Game.EndGame(gameresult, pauseBeforeQuit); }
private void Event_OnGameEnded(object sender, EventEmitter.GameResultEventArgs e) { StopGame(); result = new GameResult(e.IsDraw, e.Winner); if (e.Winner != null && e.Winner.GetType().Equals(typeof(Player))) { score.PlayerWins(); } if (e.Winner != null && e.Winner.GetType().Equals(typeof(PlayerAI))) { score.RobotWins(); } Events.OnShowScore_Event(); }
private void GameOnOnGameResult(IGameResult gameSucess) { _gamesRun++; WriteLog($"Game result:{gameSucess.Success} time:{gameSucess.ReactiontimeMillisseconds}"); if (gameSucess.Success) { _pointSucess++; _pressTimesum += gameSucess.ReactiontimeMillisseconds; } else { _pointError++; } UpdateScoreScreen(); }
private GameEngine <EntityList> CreateGameStage( IGameResult <EntityList> result = null, int?gameSeed = null ) { LoadingScreenRenderer.Render(); var isFirstStage = result == null; if (isFirstStage) { SaveGlobalConfig(); } if (gameSeed.HasValue) { GameContext.SetSeed(gameSeed.Value); } var gameConfig = YamlParser.ParseFile <RogueskivGameConfig>(AppConfig.GameModeFilesPath, AppConfig.GameMode); gameConfig.GameFPS = GameContext.GameFPS; gameConfig.GameSeed = GameContext.GameSeed; gameConfig.FloorCount = AppConfig.FloorCount; if (FloorEngines.Count == 0) { UxContext.PlayMusic(gameConfig.GameMusicFilePath, gameConfig.GameMusicVolume); } CurrentFloor = FloorEngines.Count + 1; var game = new RogueskivGame(GameStageCodes.Game, gameConfig, CurrentFloor, result, OnGameEnd); var renderer = new RogueskivRenderer(UxContext, GameContext, game, AppConfig, gameConfig); var userInput = new RogueskivInputHandler(UxContext, game, renderer); var engine = new GameEngine <EntityList>(GameContext, userInput, game, renderer); FloorEngines.Add(engine); return(engine); }
private GameEngine <EntityList> GetFloorUp(IGameResult <EntityList> result) { StopCurrentFloorEngine(); return(GetRestartFloorEngine(-1, result)); }
public virtual void Restart(IGameResult <EntityList> result) { Quit = false; Result = default; }
public bool PostStats(IGameResult gameResult) { var result = this.httpClient.PostAsync($"/evolutions/{gameResult.AlgorithmId}/result", this.ConverToContent(gameResult)).Result; return(result.IsSuccessStatusCode); }
public Task GameOver(IGameResult result) { return(_logic.EndGame(_game, result)); }
public Game(IStoreData storeData, IRunTheGame runTheGame, IGameResult gameResult) { _storeData = storeData; _runTheGame = runTheGame; _gameResult = gameResult; }