-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJogo.java
More file actions
106 lines (104 loc) · 2.57 KB
/
Jogo.java
File metadata and controls
106 lines (104 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import java.util.*;
public class Jogo {
private Tabuleiro tabuleiro;
private int turno;
private LinkedList<Jogador> jogadores;
private LinkedList<FakeNews> fakeNews;
public Jogo(int numJ)
{
LinkedList<Jogador> j = new LinkedList<Jogador>();
this.setJogadores(j);
this.criarJogadores(numJ);
LinkedList<FakeNews> f = new LinkedList<FakeNews>();
this.setFakenews(f);
this.criarFakeNews();
Tabuleiro tabuleiro = new Tabuleiro(this.jogadores, this.fakeNews);
this.setTabuleiro(tabuleiro);
this.setTurno(1);
}
public void setJogadores(LinkedList<Jogador> j)
{
this.jogadores = j;
}
public void setFakenews(LinkedList<FakeNews> f)
{
this.fakeNews = f;
}
private void setTabuleiro(Tabuleiro t)
{
this.tabuleiro = t;
}
private void setTurno(int turno)
{
if (turno > 0)
this.turno = turno;
}
public int getTurno()
{
return this.turno;
}
public Tabuleiro getTabuleiro()
{
return this.tabuleiro;
}
public LinkedList<Jogador> getJogadores()
{
return this.jogadores;
}
public LinkedList<FakeNews> getFakeNews()
{
return this.fakeNews;
}
public void incrementarTurno(){
this.setTurno(this.turno + 1);
}
private void criarJogadores(int numJ)
{
if (numJ >= 1)
{
Jogador j1 = new Jogador("J1");
j1.setLinha(0);
j1.setColuna(4);
jogadores.addFirst(j1);
}
if (numJ >= 2)
{
Jogador j2 = new Jogador("J2");
j2.setLinha(8);
j2.setColuna(4);
jogadores.addLast(j2);
}
if (numJ >= 3)
{
Jogador j3 = new Jogador("J3");
j3.setLinha(4);
j3.setColuna(8);
jogadores.addLast(j3);
}
if (numJ == 4)
{
Jogador j4 = new Jogador("J4");
j4.setLinha(4);
j4.setColuna(0);
jogadores.addLast(j4);
}
}
private void criarFakeNews()
{
for (int i = 0; i < 2; i++)
{
FakeNews1 f1 = new FakeNews1("F1");
this.fakeNews.addLast(f1);
}
for (int i = 0; i < 2; i++)
{
FakeNews2 f2 = new FakeNews2("F2");
this.fakeNews.addLast(f2);
}
for (int i = 0; i < 2; i++)
{
FakeNews3 f3 = new FakeNews3("F3");
this.fakeNews.addLast(f3);
}
}
}