Class: GameRunner

Inherits:
Object
  • Object
show all
Defined in:
game/game_runner.rb

Overview

GameRunner abstracts any clutter in the main file and contains a singular static method. This method can be called without creating an instance of GameRunner.

Author:

  • Joseph Beck

Class Method Summary collapse

Class Method Details

.runNilClass

The static method, run, creates the instance of config and gets the ip and port for the server. It then starts running the game loop.

Parameters:

  • (NilClass)

Returns:

  • (NilClass)


21
22
23
24
25
26
27
28
29
# File 'game/game_runner.rb', line 21

def self.run
  config = Config.new
  ip, port = config.ip, config.port
  name = gets

  client = Game.new(ip, port, name)
  client.run
  nil
end