Class: Settlers::Application
- Inherits:
-
Object
- Object
- Settlers::Application
- Defined in:
- lib/settlers/application.rb
Defined Under Namespace
Classes: BonjourClientGame, Client, RemoteServer, Server, StandaloneGame
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#server ⇒ Object
Returns the value of attribute server.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
- #find_server ⇒ Object
-
#initialize(*args) ⇒ Application
constructor
A new instance of Application.
- #run ⇒ Object
- #start_client(server) ⇒ Object
- #start_server ⇒ Object
Constructor Details
#initialize(*args) ⇒ Application
Returns a new instance of Application.
13 14 15 16 17 18 |
# File 'lib/settlers/application.rb', line 13 def initialize(*args) self.server = Server.new self.client = Client.new self.style = StandaloneGame (args) end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
11 12 13 |
# File 'lib/settlers/application.rb', line 11 def client @client end |
#server ⇒ Object
Returns the value of attribute server.
11 12 13 |
# File 'lib/settlers/application.rb', line 11 def server @server end |
#style ⇒ Object
Returns the value of attribute style.
11 12 13 |
# File 'lib/settlers/application.rb', line 11 def style @style end |
Instance Method Details
#find_server ⇒ Object
32 33 34 |
# File 'lib/settlers/application.rb', line 32 def find_server choose(*available_servers) end |
#run ⇒ Object
20 21 22 |
# File 'lib/settlers/application.rb', line 20 def run style.new(self).run end |
#start_client(server) ⇒ Object
28 29 30 |
# File 'lib/settlers/application.rb', line 28 def start_client(server) client.start(server) end |
#start_server ⇒ Object
24 25 26 |
# File 'lib/settlers/application.rb', line 24 def start_server server.start end |