예제 #1
0
 public void Terminar()
 {
     this.Status = false;
     BusInMemory.SendEvents(new TerminouJogoEvent()
     {
         Data = DateTime.Now
     });
 }
예제 #2
0
        public void TerminarComVencedor()
        {
            this.Status = false;

            var vencedor = this.ObterVencedor();

            this.Clear();
            Console.WriteLine($"O vencedor foi: {vencedor.Jogador.Nome} ");

            BusInMemory.SendEvents(new TerminouJogoEvent()
            {
                Data = DateTime.Now
            });
        }
예제 #3
0
        public void Comecar()
        {
            var comecarPartidaCommand = new ComecarPartidaCommand()
            {
                IdPartida = Guid.NewGuid(),
                Data      = DateTime.Now
            };

            BusInMemory.SendCommands(comecarPartidaCommand);

            Console.WriteLine("############### JOGADORES ################");
            BusInMemory.SendCommands(new AdicionarJogadoresCommand());

            Console.WriteLine("###############################");
            Console.WriteLine("###############################");
            Console.WriteLine("###############################");

            BusInMemory.SendCommands(new AdicionarJogadasCommand()
            {
                IdPartida = comecarPartidaCommand.IdPartida
            });
            Console.WriteLine("###############################");
        }
예제 #4
0
 public Partida(Guid id)
 {
     this.Id      = id;
     this.Jogadas = new List <Jogada>();
     _busInMemory = new BusInMemory();
 }