wrote basic building stuff, need to impliment more in the player.

This commit is contained in:
2026-01-12 11:36:21 -07:00
parent 6e914467ed
commit eb161e0f2e
14 changed files with 815 additions and 175 deletions
+2 -2
View File
@@ -70,7 +70,7 @@ module Game
it 're-connects the player and returns success' do
cmd = { 'payload' => { 'player_id' => player_id, 'faction' => 'good' } }
expect(game.player_connect(client_socket, cmd)).to eq('status' => 'success')
expect(game.player_connect(client_socket, cmd)).to eq({"payload"=>"success", "type"=>"update"})
expect(existing_player).to have_received(:connect).with(client_socket)
end
end
@@ -103,7 +103,7 @@ module Game
it 'creates a new player, connects them, and adds them to #players' do
cmd = { 'payload' => { 'player_id' => player_id, 'faction' => 'evil'} }
response = game.player_connect(client_socket, cmd)
expect(response).to eq('status' => 'success')
expect(response).to eq({"payload"=>"success", "type"=>"update"})
expect(game.players).to include(an_object_having_attributes(player_id:))
end
end