-
Notifications
You must be signed in to change notification settings - Fork 0
/
seed.rb
42 lines (36 loc) · 1.4 KB
/
seed.rb
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
require "faker"
require_relative './classes/teams.rb'
require_relative './classes/players.rb'
require_relative './classes/game.rb'
require_relative './classes/bot_teams.rb'
def seed
#These are the empty arrays to contain the player details generated by faker
team_1_players = []
team_2_players = []
team_3_players = []
team_4_players = []
#This is the loop to generate the player names from faker
for i in 1..5
team_1_players << Player.new(Faker::Sports::Football.unique.player, i)
end
for i in 1..5
team_2_players << Player.new(Faker::Sports::Football.unique.player, i)
end
for i in 1..5
team_3_players << Player.new(Faker::Sports::Football.unique.player, i)
end
for i in 1..5
team_4_players << Player.new(Faker::Sports::Football.unique.player, i)
end
team_1_captain = "Gigi Buffon"
team_2_captain = "Fabian Barthez"
team_3_captain = "Rene Higuita"
team_4_captain = "Mark Schwarzer"
team_1 = BotTeams.new("Barons", team_1_players, 0, team_1_captain)
team_2 = BotTeams.new("Bandits", team_2_players, 0, team_2_captain)
team_3 = BotTeams.new("Pepitas", team_3_players, 0, team_3_captain)
team_4 = BotTeams.new("Scamps", team_4_players, 0, team_4_captain)
teams_array = [team_1, team_2, team_3, team_4]
game = Game.new("Football Shootout", "5-a-Side Football Sim", teams_array)
return game
end