private void OnStriked(IStriker striker) { var handler = Striked; if (handler != null) { handler(this, striker); } }
private void OnFail(IStriker ball) { var handler = GroundCrossed; if (handler != null) { handler(ball); } }
public void Start(IBoard board, IStriker striker) { board.Initialize(8, 8); while (striker.Alive() && !striker.Finished()) { var input = Console.ReadKey(); switch (input.Key) { case ConsoleKey.UpArrow: { striker.MoveUp(); break; } case ConsoleKey.DownArrow: { striker.MoveDown(); break; } case ConsoleKey.LeftArrow: { striker.MoveLeft(); break; } case ConsoleKey.RightArrow: { striker.MoveRight(); break; } case ConsoleKey.Enter: { board.Initialize(8, 8); striker.Reset(); break; } case ConsoleKey.Escape: { return; } } } End(); }
public override void Initialize(IStriker striker, IConsoleWriter consoleWriter) { striker.ReduceLives(1); consoleWriter.WriteHitByMine(); }
private void OnBlockStriked(AbstractBlock block, IStriker striker) { _blocks.Remove(block); Destroy(block.gameObject); OnBlockCountChanged(); }
public override void Initialize(IStriker striker, IConsoleWriter consoleWriter) { consoleWriter.WriteFinalScore(striker.GetMovesTaken()); }
public virtual void Initialize(IStriker striker, IConsoleWriter renderer) { }
private void OnBallLost(IStriker ball) { OnFail(); }
public void AddStriker(IStriker str) { this.strikers.Add(str); }