Tenho como trabalho da faculdade recriar o jogo Super Trunfo todo em um código em Java. Porém continuam dando erros nas parte de iniciar o jogo e na de definir um vencedor.
public void comecar_jogo(){
int count=0;
while (!this.fimdojogo()){
this.cartasjogadas.add(this.jogadores.get(0).pegar_carta());
this.cartasjogadas.add(this.jogadores.get(1).pegar_carta());
if (count==0){
this.Atributo_escolhido = this.jogadores.get(0).escolher_atributo();
}
else{
this.ganhador_escolhendoatributo();
}
this.definirganhador();
this.jogadorsemcartas();
this.resultado();
interacao.limparconsole();
}
}
public void definirganhador(){
Card cartaganhadora=this.cartasjogadas.get(0).cartaganhadora(this.cartasjogadas, this.Atributo_escolhido);
if (cartaganhadora == null){
System.out.println(“Sem ganhador dessa vez!!!”);
} else {
for(int i = 0; i < this.jogadores.size(); i++){
if (this.jogadores.get(i).cartasjogadas == cartaganhadora){
System.out.println(“Jogador ganhador da rodada:>>>” + this.jogadores.get(i).Nome);
for(Card elemento: this.cartasjogadas){
this.jogadores.get(i).cards.add(elemento);
}
this.cartasjogadas.clear();
}
}
}
}
4 errors
Main.java: error: int cannot be dereferenced
if (this.jogadores.get(i.ganhou_a_rodada)){
^
Main.java: error: cannot find symbol
while (!this.fimdojogo()){
^
symbol: method fimdojogo()
Main.java: error: cannot find symbol
Card cartaganhadora=this.cartasjogadas.get(0).cartaganhadora(this.cartasjogadas, this.Atributo_escolhido);
^
symbol: method cartaganhadora(ArrayList,int)
location: class Card
Main.java: error: cannot find symbol
if (this.jogadores.get(i).cartasjogadas == cartaganhadora){
^
symbol: variable cartasjogadas
location: class jogador