-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path@game
More file actions
27 lines (24 loc) · 1.45 KB
/
Copy path@game
File metadata and controls
27 lines (24 loc) · 1.45 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
[1mFrom:[0m /home/jefferson/API/api-w/app/controllers/games_controller.rb @ line 19 GamesController#new:
[1;34m6[0m: [32mdef[0m [1;34mnew[0m
[1;34m7[0m: [1;34m##url = http://localhost:3000/games/new?n_objectives=14&n_territories=42&n_players=5[0m
[1;34m8[0m: [32mif[0m params
[1;34m9[0m:
[1;34m10[0m: n_territories = params[[33m:n_territories[0m]
[1;34m11[0m: n_objectives = params[[33m:n_objectives[0m]
[1;34m12[0m: n_players = params[[33m:n_players[0m]
[1;34m13[0m: [1;34m##TODO: criar forma de armazenar id_jogo[0m
[1;34m14[0m: [1;34m#aqui se cria um jogo[0m
[1;34m15[0m: hash_ter = draw_territory n_players, n_territories
[1;34m16[0m: hash_obj = draw_objectives n_players, n_objectives
[1;34m17[0m: arr_odr = player_order n_players
[1;34m18[0m: @game = [1;34;4mGame[0m.new([33m:n_pla[0m => n_players,[33m:n_terr[0m => n_territories,[33m:n_obj[0m => n_objectives )
=> [1;34m19[0m: binding.pry
[1;34m20[0m: game = {
[1;34m21[0m: [33m:id_game[0m => @game.id,
[1;34m22[0m: [33m:territories[0m => hash_ter,
[1;34m23[0m: [33m:objectives[0m => hash_obj,
[1;34m24[0m: [33m:player_order[0m => arr_odr
[1;34m25[0m: }
[1;34m26[0m: render [33m:json[0m => game.to_json
[1;34m27[0m: [32mend[0m
[1;34m28[0m: [32mend[0m